File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load diff This file was deleted.
Original file line number Diff line number Diff line change 11name : Release
22
33on :
4+ push :
5+ branches : [main]
46 release :
57 types : [published]
68
1416
1517 strategy :
1618 matrix :
17- node-version : [22 ]
19+ node-version : [24 ]
1820
1921 steps :
2022 - uses : actions/checkout@v4
@@ -32,11 +34,20 @@ jobs:
3234 - name : Test
3335 run : npm test
3436
35- - name : Calculate environment variables
37+ - name : Resolve release metadata
3638 run : |
37- echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV
39+ if [ "${{ github.event_name }}" = "release" ]; then
40+ echo "RELEASE_KIND=release" >> $GITHUB_ENV
41+ echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV
42+ else
43+ echo "RELEASE_KIND=insiders" >> $GITHUB_ENV
44+ echo "INSIDERS_VERSION=0.0.0-insiders.$(git rev-parse --short HEAD)" >> $GITHUB_ENV
45+ echo "RELEASE_CHANNEL=insiders" >> $GITHUB_ENV
46+ fi
47+
48+ - name : Version based on commit
49+ if : env.RELEASE_KIND == 'insiders'
50+ run : npm version "$INSIDERS_VERSION" --force --no-git-tag-version
3851
3952 - name : Publish
40- run : npm publish --provenance --tag ${{ env.RELEASE_CHANNEL }}
41- env :
42- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
53+ run : npm publish --provenance --tag "$RELEASE_CHANNEL"
Original file line number Diff line number Diff line change 1010let version =
1111 process . argv [ 2 ] || process . env . npm_package_version || require ( '../package.json' ) . version
1212
13- let match = / \d + \. \d + \. \d + - ( .* ) \. \d + / g. exec ( version )
13+ let match = / \d + \. \d + \. \d + - ( .* ) ( \. \d + ) ? / g. exec ( version )
1414if ( match ) {
1515 console . log ( match [ 1 ] )
1616} else {
You can’t perform that action at this time.
0 commit comments