Skip to content

Create Dedicated Pipeline to Create Tarball Packages #4891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions common/config/azure-pipelines/npm-publish-tarballs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
parameters:
- name: TestRun
displayName: 'Test Run (Will Not Create Tar Files for Rushstack)'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that publishing the artifact does not have any direct consequences, there's no reason to have a dryRun option for this pipeline.

type: boolean
default: true

variables:
- name: FORCE_COLOR
value: 1
- name: SourceBranch
value: $[ replace(replace(resources.repositories.self.ref, 'refs/heads/', ''), 'refs/pull/', 'refs/remotes/pull/') ]

resources:
repositories:
- 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-tarballs
os: linux
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.ArtifactStagingDirectory)/published-versions
artifactName: published-versions
Comment on lines +29 to +31
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how you publish a pipeline artifact. There should be another entry like this pointing to the output folder from the rush publish --pack command; that will produce your artifact for consumption in the separate publish pipeline.

- output: pipelineArtifact
targetPath: $(Build.ArtifactStagingDirectory)/packages
artifactNames: packages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
artifactNames: packages
artifactName: packages

steps:
- checkout: self
persistCredentials: true

- 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/bump-versions.yaml@self
parameters:
VersionPolicyName: noRush
BranchName: $(SourceBranch)

- script: 'node libraries/rush-lib/scripts/plugins-prepublish.js'
displayName: 'Prepublish workaround for rush-lib'

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

- template: /common/config/azure-pipelines/templates/record-published-versions.yaml@self
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
steps:
- bash: >
mkdir -p $(Build.ArtifactStagingDirectory)/packages
displyName: 'Create Folder for Packages File'

- script: 'node common/scripts/install-run-rush.js publish --publish --pack --include-all --release-folder esrp-release'
displayName: 'Create TarBallz folder for Rush packages'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- bash: >
mkdir -p $(Build.ArtifactStagingDirectory)/packages
displyName: 'Create Folder for Packages File'
- script: 'node common/scripts/install-run-rush.js publish --publish --pack --include-all --release-folder esrp-release'
displayName: 'Create TarBallz folder for Rush packages'
- script: |
mkdir -p $(Build.ArtifactStagingDirectory)/packages
node common/scripts/install-run-rush.js publish --publish --pack --include-all --release-folder "$(Build.ArtifactStagingDirectory)/packages"
displayName: 'Pack tarballs'

Loading