Skip to content

Commit 190aac0

Browse files
iclantonclaude
andauthored
Pack packages and publish them as an AzDO artifact during publish operations. (#5594)
* Add package packing and artifact publishing to AzDO pipelines Refactor npm-publish and npm-publish-rush pipelines to pack all packages and publish them as pipeline artifacts in addition to publishing to npm. Add a publishToNpmFeed parameter (default: true) to optionally disable npm feed publishing and only produce pipeline artifacts. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Add Claude Code local configuration to gitignore Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix YAML parse error by moving condition inside templates Azure Pipelines doesn't support condition on template calls directly. Move the publishToNpmFeed condition inside the publish.yaml template and pass the parameter from the pipeline files. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Add --publish flag to rush publish --pack command The --pack parameter requires --publish to be specified for it to actually pack the packages. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fixup! Fix YAML parse error by moving condition inside templates * Add outputParentDirectory to templateContext in npm-publish YAML files --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 62ce9a0 commit 190aac0

4 files changed

Lines changed: 44 additions & 12 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,6 @@ dist-storybook/
134134
playwright-report/
135135
test-results/
136136

137+
# Claude Code local configuration
138+
.claude/*.local.json
139+

common/config/azure-pipelines/npm-publish-rush.yaml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
parameters:
2+
- name: publishToNpmFeed
3+
displayName: 'Publish to npm feed'
4+
type: boolean
5+
default: true
6+
17
variables:
28
- name: FORCE_COLOR
39
value: 1
@@ -25,13 +31,17 @@ extends:
2531
name: publish-rushstack
2632
os: linux
2733
templateContext:
34+
outputParentDirectory: $(Build.ArtifactStagingDirectory)
2835
outputs:
2936
- output: pipelineArtifact
3037
targetPath: $(Build.ArtifactStagingDirectory)/published-versions
3138
artifactName: published-versions
3239
- output: pipelineArtifact
3340
targetPath: $(Build.ArtifactStagingDirectory)/json-schemas
3441
artifactName: json-schemas
42+
- output: pipelineArtifact
43+
targetPath: $(Build.ArtifactStagingDirectory)/packages
44+
artifactName: packages
3545
steps:
3646
- checkout: self
3747
persistCredentials: true
@@ -53,14 +63,17 @@ extends:
5363
- script: 'node libraries/rush-lib/scripts/plugins-prepublish.js'
5464
displayName: 'Prepublish workaround for rush-lib'
5565

56-
- template: /common/config/azure-pipelines/templates/publish.yaml@self
57-
parameters:
58-
VersionPolicyName: noRush
59-
BranchName: $(SourceBranch)
66+
- template: /common/config/azure-pipelines/templates/pack.yaml@self
6067

61-
- template: /common/config/azure-pipelines/templates/publish.yaml@self
62-
parameters:
63-
VersionPolicyName: rush
64-
BranchName: $(SourceBranch)
68+
- ${{ if eq(parameters.publishToNpmFeed, true) }}:
69+
- template: /common/config/azure-pipelines/templates/publish.yaml@self
70+
parameters:
71+
VersionPolicyName: noRush
72+
BranchName: $(SourceBranch)
73+
74+
- template: /common/config/azure-pipelines/templates/publish.yaml@self
75+
parameters:
76+
VersionPolicyName: rush
77+
BranchName: $(SourceBranch)
6578

6679
- template: /common/config/azure-pipelines/templates/post-publish.yaml@self

common/config/azure-pipelines/npm-publish.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
parameters:
2+
- name: publishToNpmFeed
3+
displayName: 'Publish to npm feed'
4+
type: boolean
5+
default: true
6+
17
variables:
28
- name: FORCE_COLOR
39
value: 1
@@ -25,13 +31,17 @@ extends:
2531
name: publish-rushstack
2632
os: linux
2733
templateContext:
34+
outputParentDirectory: $(Build.ArtifactStagingDirectory)
2835
outputs:
2936
- output: pipelineArtifact
3037
targetPath: $(Build.ArtifactStagingDirectory)/published-versions
3138
artifactName: published-versions
3239
- output: pipelineArtifact
3340
targetPath: $(Build.ArtifactStagingDirectory)/json-schemas
3441
artifactName: json-schemas
42+
- output: pipelineArtifact
43+
targetPath: $(Build.ArtifactStagingDirectory)/packages
44+
artifactName: packages
3545
steps:
3646
- checkout: self
3747
persistCredentials: true
@@ -48,9 +58,12 @@ extends:
4858
- script: 'node libraries/rush-lib/scripts/plugins-prepublish.js'
4959
displayName: 'Prepublish workaround for rush-lib'
5060

51-
- template: /common/config/azure-pipelines/templates/publish.yaml@self
52-
parameters:
53-
VersionPolicyName: noRush
54-
BranchName: $(SourceBranch)
61+
- template: /common/config/azure-pipelines/templates/pack.yaml@self
62+
63+
- ${{ if eq(parameters.publishToNpmFeed, true) }}:
64+
- template: /common/config/azure-pipelines/templates/publish.yaml@self
65+
parameters:
66+
VersionPolicyName: noRush
67+
BranchName: $(SourceBranch)
5568

5669
- template: /common/config/azure-pipelines/templates/post-publish.yaml@self
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
steps:
2+
- script: 'node common/scripts/install-run-rush.js publish --publish --pack --include-all --release-folder $(Build.ArtifactStagingDirectory)/packages'
3+
displayName: 'Rush Pack'

0 commit comments

Comments
 (0)