File tree Expand file tree Collapse file tree 4 files changed +63
-0
lines changed Expand file tree Collapse file tree 4 files changed +63
-0
lines changed Original file line number Diff line number Diff line change 88jobs :
99 test :
1010 uses : viamrobotics/viam-typescript-sdk/.github/workflows/test.yml@main
11+
12+ publish_next :
13+ needs : test
14+ uses : viamrobotics/viam-typescript-sdk/.github/workflows/publish_next.yml@main
15+ secrets :
16+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : NPM Publish Next
2+
3+ on :
4+ workflow_call :
5+ secrets :
6+ NPM_TOKEN :
7+ required : true
8+
9+ jobs :
10+ publish_next :
11+ if : github.repository_owner == 'viamrobotics'
12+ runs-on : [self-hosted, x64]
13+ container :
14+ image : ghcr.io/viamrobotics/canon:amd64
15+
16+ steps :
17+ - name : Checkout
18+ uses : actions/checkout@v3
19+ with :
20+ persist-credentials : false
21+
22+ - name : Build
23+ run : |
24+ sudo chown -R testbot .
25+ sudo -u testbot bash -lc 'make build'
26+
27+ - name : Publish (dry run)
28+ id : check_new_version
29+ uses : JS-DevTools/npm-publish@v2
30+ with :
31+ token : ${{ secrets.NPM_TOKEN }}
32+ tag : next
33+ dry-run : true
34+
35+ - name : Validate version name
36+ if : ${{ steps.check_new_version.outputs.type }}
37+ shell : bash
38+ run : |
39+ if [[ ! "$(npm pkg get version)" =~ ^\"[0-9]+\.[0-9]+\.[0-9]\-next\.[0-9]+\"$ ]]; then
40+ echo "::error::Cannot publish an off-cycle version named: $(npm pkg get version). Please run 'make bump-next-version' to generate a valid version name."
41+ exit 1
42+ fi
43+
44+ - name : Publish
45+ if : ${{ steps.check_new_version.outputs.type }}
46+ uses : JS-DevTools/npm-publish@v2
47+ with :
48+ token : ${{ secrets.NPM_TOKEN }}
49+ tag : next
Original file line number Diff line number Diff line change 6868 run : |
6969 if ${{ contains(steps.current_version.outputs.current_version, 'rc') }} ; then
7070 npm version prerelease --preid=rc --no-git-tag-version
71+ elif ${{ contains(steps.current_version.outputs.current_version, 'next') && inputs.version == 'prepatch' }} ; then
72+ npm version prerelease --preid=rc --no-git-tag-version
7173 else
7274 npm version ${{ inputs.version }} --preid=rc --no-git-tag-version
7375 fi
Original file line number Diff line number Diff line change @@ -71,6 +71,12 @@ build-js: $(node_modules) clean-js build-buf
7171pack : build
7272 npm pack
7373
74+ # bump to the next pre-release version on the `next` distribution tag -
75+ # run this command if you need to publish an off-cycle release of the sdk
76+ .PHONY : bump-next-version
77+ bump-next-version :
78+ npm version --no-git-tag-version prerelease --preid=next
79+
7480# docs targets
7581
7682.PHONY : clean-docs
You can’t perform that action at this time.
0 commit comments