Skip to content

Commit

Permalink
Refactor AzDO pipelines.
Browse files Browse the repository at this point in the history
  • Loading branch information
iclanton committed May 28, 2024
1 parent f3690de commit bebbea2
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 55 deletions.
14 changes: 0 additions & 14 deletions common/config/azure-pipelines/ci-build.yaml

This file was deleted.

59 changes: 47 additions & 12 deletions common/config/azure-pipelines/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,48 @@
pool:
vmImage: 'ubuntu-latest'
variables:
NodeVersion: 18
FORCE_COLOR: 1
steps:
- checkout: self
persistCredentials: true
- template: templates/build.yaml
- script: 'node common/scripts/install-run-rush.js version --bump --version-policy BOGUS --target-branch $(Build.SourceBranchName)'
displayName: 'Rush Version'
- script: 'node common/scripts/install-run-rush.js publish --apply --publish --include-all --npm-auth-token $(npmToken)'
displayName: 'Rush Publish'
- name: SourceBranch
value: $[ replace(replace(resources.repositories.self.ref, 'refs/heads/', ''), 'refs/pull/', 'refs/remotes/pull/') ]

resources:
repositories:
- repository: RushstackMainRepo
type: github
name: Microsoft/rushstack
endpoint: 'GitHub (Rushbot)'
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
pool:
name: Azure-Pipelines-1ESPT-ExDShared
os: windows
stages:
- stage:
jobs:
- job:
pool:
name: publish-rushstack
os: linux
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.ArtifactStagingDirectory)/published-versions
artifactName: published-versions
steps:
- checkout: self
persistCredentials: true
path: tsdoc

- template: /common/config/azure-pipelines/templates/install-node.yaml@self

- template: /common/config/azure-pipelines/templates/build.yaml@self

- template: /common/config/azure-pipelines/templates/publish.yaml@self
parameters:
VersionPolicyName: noRush
BranchName: $(SourceBranch)

- template: /common/config/azure-pipelines/templates/record-published-versions.yaml@self
11 changes: 0 additions & 11 deletions common/config/azure-pipelines/npm-republish.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion common/config/azure-pipelines/playground-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
steps:
- checkout: self

- template: ./templates/build.yaml
- template: /common/config/azure-pipelines/templates/install-node.yaml@self

- template: /common/config/azure-pipelines/templates/build.yaml@self

- publish: playground/dist
artifact: 'playground'
Expand Down
25 changes: 13 additions & 12 deletions common/config/azure-pipelines/templates/build.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
steps:
- task: NodeTool@0
displayName: 'Use Node $(NodeVersion).x'
inputs:
versionSpec: '$(NodeVersion).x'
checkLatest: true
- template: ./configure-git.yaml
- script: 'git config --local user.email rushbot@users.noreply.github.com'
displayName: 'git config email'
workingDirectory: '$(Agent.BuildDirectory)/tsdoc'

- script: 'git config --local user.name Rushbot'
displayName: 'git config name'
workingDirectory: '$(Agent.BuildDirectory)/tsdoc'

- script: 'node common/scripts/install-run-rush.js change --verify'
displayName: 'Verify Change Logs'
- script: 'node common/scripts/install-run-rush.js check'
displayName: 'Rush Check'
workingDirectory: '$(Agent.BuildDirectory)/tsdoc'

- script: 'node common/scripts/install-run-rush.js install'
displayName: 'Rush Install'
workingDirectory: '$(Agent.BuildDirectory)/tsdoc'

- script: 'node common/scripts/install-run-rush.js retest --verbose --production'
displayName: 'Rush retest'
env:
# Prevent time-based browserslist update warning
# See https://github.com/microsoft/rushstack/issues/2981
BROWSERSLIST_IGNORE_OLD_DATA: 1
workingDirectory: '$(Agent.BuildDirectory)/tsdoc'
8 changes: 8 additions & 0 deletions common/config/azure-pipelines/templates/bump-versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
parameters:
- name: BranchName
type: string
default: $(Build.SourceBranchName)

steps:
- script: 'node common/scripts/install-run-rush.js version --bump --version-policy BOGUS --target-branch ${{ parameters.BranchName }}'
displayName: 'Rush Version'
5 changes: 0 additions & 5 deletions common/config/azure-pipelines/templates/configure-git.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions common/config/azure-pipelines/templates/install-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
parameters:
- name: NodeMajorVersion
type: number
default: 18

steps:
- task: NodeTool@0
inputs:
versionSpec: '${{ parameters.NodeMajorVersion }}.x'
displayName: 'Install Node.js ${{ parameters.NodeMajorVersion }}'
10 changes: 10 additions & 0 deletions common/config/azure-pipelines/templates/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
steps:
- script: 'node common/scripts/install-run-rush.js version --bump --version-policy tsdoc --target-branch $(Build.SourceBranchName)'
displayName: 'Rush Version'
workingDirectory: '$(Agent.BuildDirectory)/tsdoc'

- script: 'node common/scripts/install-run-rush.js publish --apply --publish --include-all --target-branch $(Build.SourceBranchName) --add-commit-details --set-access-level public'
displayName: 'Rush Publish'
env:
NPM_AUTH_TOKEN: $(npmToken)
workingDirectory: '$(Agent.BuildDirectory)/tsdoc'
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
steps:
- checkout: RushstackMainRepo
path: rushstack

- script: 'git config --local user.email rushbot@users.noreply.github.com'
displayName: 'git config email'
workingDirectory: '$(Agent.BuildDirectory)/rushstack'

- script: 'git config --local user.name Rushbot'
displayName: 'git config name'
workingDirectory: '$(Agent.BuildDirectory)/rushstack'

- script: 'node common/scripts/install-run-rush.js install --to repo-toolbox'
displayName: 'Rush Install (rushstack)'
workingDirectory: '$(Agent.BuildDirectory)/rushstack'

- script: 'node common/scripts/install-run-rush.js build --verbose --production --to repo-toolbox'
displayName: 'Rush Rebuild (rushstack)'
workingDirectory: '$(Agent.BuildDirectory)/rushstack'

- script: 'node $(Agent.BuildDirectory)/rushstack/repo-scripts/repo-toolbox/lib/start.js record-versions --out-file $(Build.ArtifactStagingDirectory)/published-versions/published-versions.json'
displayName: 'Record Published Versions'
workingDirectory: '$(Agent.BuildDirectory)/tsdoc'

# Published by the 1ES template
# - publish: $(Build.ArtifactStagingDirectory)/published-versions
# artifact: published-versions
# displayName: 'Publish Artifact: published-versions'
4 changes: 4 additions & 0 deletions common/config/rush/.npmrc-publish
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
#
# //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}
#

registry=https://registry.npmjs.org/
always-auth=true
//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}

0 comments on commit bebbea2

Please sign in to comment.