V14: Publish Bellissima package to npm via Pipelines (#14926)
* ignore node_modules specifically to limit size of build_output * build and publish backoffice artifacts * instruct GitVersioning to output all variables such as npm to use in Pipelines * use NBGV variables * prepare npm package for nightlies * instruct to deploy to MyGet for nightlies * Deploy to npm only after Myget * add public access to publish * write scopes to .npmrc file * add scope to registry.npmjs.org * nightly param
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
**/*
|
**/*
|
||||||
!**/bin/**
|
!**/bin/**
|
||||||
!**/obj/**
|
!**/obj/**
|
||||||
|
**/node_modules
|
||||||
|
|||||||
@@ -13,6 +13,14 @@ parameters:
|
|||||||
displayName: Deploy to NuGet
|
displayName: Deploy to NuGet
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
- name: npmDeploy
|
||||||
|
displayName: Deploy to Npm
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
- name: npmPublishTag
|
||||||
|
displayName: Npm publish tag
|
||||||
|
type: string
|
||||||
|
default: 'latest'
|
||||||
- name: buildApiDocs
|
- name: buildApiDocs
|
||||||
displayName: Build API docs
|
displayName: Build API docs
|
||||||
type: boolean
|
type: boolean
|
||||||
@@ -41,6 +49,10 @@ parameters:
|
|||||||
displayName: TestFilter used for release type builds on non windows agents
|
displayName: TestFilter used for release type builds on non windows agents
|
||||||
type: string
|
type: string
|
||||||
default: ' '
|
default: ' '
|
||||||
|
- name: isNightly
|
||||||
|
displayName: 'Is nightly build (used for MyGet feed)'
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
nodeVersion: 20
|
nodeVersion: 20
|
||||||
@@ -93,13 +105,13 @@ stages:
|
|||||||
targets: coreBuild
|
targets: coreBuild
|
||||||
workingDirectory: src/Umbraco.Web.UI.Client
|
workingDirectory: src/Umbraco.Web.UI.Client
|
||||||
- script: npm ci --no-fund --no-audit --prefer-offline
|
- script: npm ci --no-fund --no-audit --prefer-offline
|
||||||
workingDirectory: src/Umbraco.Web.UI.New.Client
|
displayName: Run npm ci (Bellissima)
|
||||||
displayName: Run npm ci
|
workingDirectory: src/Umbraco.Web.UI.New.Client
|
||||||
- script: npm run build:for:cms
|
- script: npm run build:for:cms
|
||||||
displayName: Run New Backoffice Build
|
displayName: Run build (Bellissima)
|
||||||
workingDirectory: src/Umbraco.Web.UI.New.Client
|
workingDirectory: src/Umbraco.Web.UI.New.Client
|
||||||
- script: npm run build
|
- script: npm run build
|
||||||
displayName: Run Login Build
|
displayName: Run Login Build (Bellissima)
|
||||||
workingDirectory: src/Umbraco.Web.UI.New.Client/apps/auth
|
workingDirectory: src/Umbraco.Web.UI.New.Client/apps/auth
|
||||||
- task: UseDotNet@2
|
- task: UseDotNet@2
|
||||||
displayName: Use .NET $(dotnetVersion)
|
displayName: Use .NET $(dotnetVersion)
|
||||||
@@ -128,6 +140,24 @@ stages:
|
|||||||
inputs:
|
inputs:
|
||||||
targetPath: $(Build.SourcesDirectory)
|
targetPath: $(Build.SourcesDirectory)
|
||||||
artifactName: build_output
|
artifactName: build_output
|
||||||
|
- bash: |
|
||||||
|
echo "##[command]Running npm version"
|
||||||
|
echo "##[debug]Version: $PACKAGE_VERSION"
|
||||||
|
echo "##[command]Running npm pack"
|
||||||
|
echo "##[debug]Output directory: $(Build.ArtifactStagingDirectory)"
|
||||||
|
npm version $PACKAGE_VERSION --allow-same-version --no-git-tag-version
|
||||||
|
mkdir $(Build.ArtifactStagingDirectory)/npm
|
||||||
|
npm pack --pack-destination $(Build.ArtifactStagingDirectory)/npm
|
||||||
|
mv .npmrc $(Build.ArtifactStagingDirectory)/npm/
|
||||||
|
displayName: Prepare Bellissima npm package
|
||||||
|
env:
|
||||||
|
PACKAGE_VERSION: $(build.NBGV_NpmPackageVersion)
|
||||||
|
workingDirectory: src/Umbraco.Web.UI.New.Client
|
||||||
|
- task: PublishPipelineArtifact@1
|
||||||
|
displayName: Publish Bellissima npm artifact
|
||||||
|
inputs:
|
||||||
|
targetPath: $(Build.ArtifactStagingDirectory)/npm
|
||||||
|
artifactName: npm
|
||||||
|
|
||||||
- stage: Build_Docs
|
- stage: Build_Docs
|
||||||
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.buildApiDocs}}))
|
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.buildApiDocs}}))
|
||||||
@@ -570,7 +600,45 @@ stages:
|
|||||||
command: 'push'
|
command: 'push'
|
||||||
packagesToPush: $(Build.ArtifactStagingDirectory)/**/*.nupkg
|
packagesToPush: $(Build.ArtifactStagingDirectory)/**/*.nupkg
|
||||||
nuGetFeedType: 'external'
|
nuGetFeedType: 'external'
|
||||||
publishFeedCredentials: 'MyGet - Pre-releases'
|
${{ if eq(parameters.isNightly, true) }}:
|
||||||
|
publishFeedCredentials: 'MyGet - Umbraco Nightly'
|
||||||
|
${{ else }}:
|
||||||
|
publishFeedCredentials: 'MyGet - Pre-releases'
|
||||||
|
- job:
|
||||||
|
displayName: Push to pre-release feed (npm)
|
||||||
|
steps:
|
||||||
|
- checkout: none
|
||||||
|
- download: current
|
||||||
|
artifact: npm
|
||||||
|
- bash: |
|
||||||
|
# Check if we are on a nightly build
|
||||||
|
if [ $isNightly = "False" ]; then
|
||||||
|
echo "##[debug]Prerelease build detected"
|
||||||
|
registry="https://www.myget.org/F/umbracoprereleases/npm/"
|
||||||
|
else
|
||||||
|
echo "##[debug]Nightly build detected"
|
||||||
|
registry="https://www.myget.org/F/umbraconightly/npm/"
|
||||||
|
fi
|
||||||
|
echo "@umbraco-cms:registry=$registry" >> .npmrc
|
||||||
|
env:
|
||||||
|
isNightly: ${{parameters.isNightly}}
|
||||||
|
workingDirectory: $(Pipeline.Workspace)/npm
|
||||||
|
displayName: Add scoped registry to .npmrc
|
||||||
|
- task: npmAuthenticate@0
|
||||||
|
displayName: Authenticate with npm (MyGet)
|
||||||
|
inputs:
|
||||||
|
workingFile: '$(Pipeline.Workspace)/npm/.npmrc'
|
||||||
|
customEndpoint: 'MyGet (npm) - Umbracoprereleases, MyGet (npm) - Umbraconightly'
|
||||||
|
- bash: |
|
||||||
|
# Setup temp npm project to load in defaults from the local .npmrc
|
||||||
|
npm init -y
|
||||||
|
|
||||||
|
# Find the first .tgz file in the current directory and publish it
|
||||||
|
files=( ./*.tgz )
|
||||||
|
npm publish --access public "${files[0]}"
|
||||||
|
displayName: Push to npm (MyGet)
|
||||||
|
workingDirectory: $(Pipeline.Workspace)/npm
|
||||||
|
|
||||||
- stage: Deploy_NuGet
|
- stage: Deploy_NuGet
|
||||||
displayName: NuGet release
|
displayName: NuGet release
|
||||||
dependsOn:
|
dependsOn:
|
||||||
@@ -595,14 +663,43 @@ stages:
|
|||||||
nuGetFeedType: 'external'
|
nuGetFeedType: 'external'
|
||||||
publishFeedCredentials: 'NuGet - Umbraco.*'
|
publishFeedCredentials: 'NuGet - Umbraco.*'
|
||||||
|
|
||||||
|
- stage: Deploy_Npm
|
||||||
|
displayName: Npm release
|
||||||
|
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.npmDeploy}}))
|
||||||
|
dependsOn:
|
||||||
|
- Deploy_NuGet
|
||||||
|
jobs:
|
||||||
|
- job: Publish
|
||||||
|
displayName: Push to NPM
|
||||||
|
steps:
|
||||||
|
- checkout: none
|
||||||
|
- download: current
|
||||||
|
artifact: npm
|
||||||
|
- bash: echo "@umbraco-cms:registry=https://registry.npmjs.org" >> .npmrc
|
||||||
|
workingDirectory: $(Pipeline.Workspace)/npm
|
||||||
|
displayName: Add scoped registry to .npmrc
|
||||||
|
- task: npmAuthenticate@0
|
||||||
|
displayName: Authenticate with npm
|
||||||
|
inputs:
|
||||||
|
workingFile: $(Pipeline.Workspace)/npm/.npmrc
|
||||||
|
customEndpoint: 'NPM - Umbraco Backoffice'
|
||||||
|
- script: |
|
||||||
|
# Setup temp npm project to load in defaults from the local .npmrc
|
||||||
|
npm init -y
|
||||||
|
|
||||||
|
# Find the first .tgz file in the current directory and publish it
|
||||||
|
files=( ./*.tgz )
|
||||||
|
npm publish --tag $npmTag --access public "${files[0]}"
|
||||||
|
displayName: Push to npm
|
||||||
|
workingDirectory: $(Pipeline.Workspace)/npm
|
||||||
|
|
||||||
- stage: Upload_API_Docs
|
- stage: Upload_API_Docs
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'windows-latest' # Apparently AzureFileCopy is windows only :(
|
vmImage: 'windows-latest' # Apparently AzureFileCopy is windows only :(
|
||||||
variables:
|
variables:
|
||||||
umbracoMajorVersion: $[ stageDependencies.Build.A.outputs['build.NBGV_VersionMajor'] ]
|
umbracoMajorVersion: $[ dependencies.Build.outputs['A.build.NBGV_VersionMajor'] ]
|
||||||
displayName: Upload API Documentation
|
displayName: Upload API Documentation
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- Build
|
|
||||||
- Deploy_MyGet # Change to "Deploy_Nuget" after release of v14
|
- Deploy_MyGet # Change to "Deploy_Nuget" after release of v14
|
||||||
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.uploadApiDocs}}))
|
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.uploadApiDocs}}))
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ schedules:
|
|||||||
- v14/dev
|
- v14/dev
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- checkout: none
|
||||||
- task: TriggerBuild@4
|
- task: TriggerBuild@4
|
||||||
inputs:
|
inputs:
|
||||||
definitionIsInCurrentTeamProject: true
|
definitionIsInCurrentTeamProject: true
|
||||||
@@ -26,10 +27,10 @@ steps:
|
|||||||
useSameBranch: true
|
useSameBranch: true
|
||||||
waitForQueuedBuildsToFinish: false
|
waitForQueuedBuildsToFinish: false
|
||||||
storeInEnvironmentVariable: false
|
storeInEnvironmentVariable: false
|
||||||
templateParameters: 'sqlServerIntegrationTests: true, forceReleaseTestFilter: true'
|
templateParameters: 'sqlServerIntegrationTests: true, forceReleaseTestFilter: true, myGetDeploy: true, isNightly: true'
|
||||||
authenticationMethod: 'OAuth Token'
|
authenticationMethod: 'OAuth Token'
|
||||||
enableBuildInQueueCondition: false
|
enableBuildInQueueCondition: false
|
||||||
dependentOnSuccessfulBuildCondition: false
|
dependentOnSuccessfulBuildCondition: false
|
||||||
dependentOnFailedBuildCondition: false
|
dependentOnFailedBuildCondition: false
|
||||||
checkbuildsoncurrentbranch: false
|
checkbuildsoncurrentbranch: false
|
||||||
failTaskIfConditionsAreNotFulfilled: false
|
failTaskIfConditionsAreNotFulfilled: false
|
||||||
|
|||||||
Submodule src/Umbraco.Web.UI.New.Client updated: 653b707e81...bf6be57e7c
@@ -17,9 +17,7 @@
|
|||||||
"tagName": "release-{version}"
|
"tagName": "release-{version}"
|
||||||
},
|
},
|
||||||
"cloudBuild": {
|
"cloudBuild": {
|
||||||
"setAllVariables": true,
|
"setVersionVariables": true,
|
||||||
"buildNumber": {
|
"setAllVariables": true
|
||||||
"enabled": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user