1- name : Release Pipeline
1+ name : Publish Test Version
22
33on :
44 # Allows triggering the workflow manually
55 workflow_dispatch :
66 inputs :
7- provider_version :
7+ version :
88 description : " Build and publish to NPM"
9- required : false
10- default : " v0.17.4-test.1"
9+ required : true
10+ default : " 3.9.0"
11+ tag :
12+ description : " Tag to apply to the release"
13+ required : true
14+ default : " test.1"
1115
1216# We're going to interact with GH from the pipelines, so we need to get some permissions
1317permissions :
1418 contents : read # for checkout
1519
1620jobs :
1721 release :
18- name : Release the SDK to NPM and GitHub
22+ name : Build and Publish ${{ github.event.inputs.version }}-${{ github.event.inputs.tag }}
1923 runs-on : ubuntu-latest
2024 permissions :
2125 contents : write # to be able to publish a GitHub release
@@ -32,34 +36,26 @@ jobs:
3236 uses : actions/setup-node@v4
3337 with :
3438 # Semantic release requires this as bare minimum
35- node-version : 20
36-
37- # Why this? https://github.com/npm/cli/issues/7279
38- # Why this way? https://github.com/actions/setup-node/issues/213
39- - name : Install latest npm
40- shell : bash
41- run : |
42- npm install -g npm@latest &&
43- npm --version &&
44- npm list -g --depth 0
39+ node-version : 24
4540
4641 - name : Install dependencies
4742 run : npm install
4843
49- - name : Verify the integrity of provenance attestations and registry signatures for installed dependencies
50- run : npm audit signatures
44+ - name : Setup npm auth
45+ run : |
46+ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
47+ env :
48+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
49+
50+ - name : Set version to ${{ github.event.inputs.version }}-${{ github.event.inputs.tag }}
51+ run : |
52+ set -x
53+ npm version ${{ github.event.inputs.version }}-${{ github.event.inputs.tag }} --no-git-tag-version
5154
5255 - name : Build the SDK for release
53- run : npm run build
56+ run : |
57+ npm run build
5458
55- - name : Release
56- env :
57- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
58- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
59+ - name : Publish to NPM - ${{ github.event.inputs.version }}-${{ github.event.inputs.tag }}
5960 run : |
60- npm version ${{ github.event.inputs.version }} --no-git-tag-version
61- npm build
62- npm publish
63- git tag v${{ github.event.inputs.version }}
64- git push
65- git push --tags
61+ npm publish --tag ${{ github.event.inputs.tag }}
0 commit comments