1616 - preminor
1717 - prepatch
1818 - prerelease
19- dry-run :
19+ preid :
20+ description : ' Prerelease identifier (see "npm version") for pre* bumps'
21+ type : string
22+ required : false
23+ npmPreTag :
24+ description : ' NPM tag used for all pre* bumps'
25+ type : string
26+ default : ' next'
27+ required : false
28+ dryRun :
2029 description : ' Run in "dry run" mode'
2130 type : boolean
2231 default : false
4958 - name : Install dependencies
5059 run : npm install
5160
61+ - name : List of installed dependencies
62+ run : npm ls -a
63+
5264 - name : Verifying provenance attestations
5365 run : npm audit signatures
5466
@@ -57,25 +69,28 @@ jobs:
5769
5870 - name : Bump version and create tag
5971 id : bump-version
72+ env :
73+ PREID_FLAG : ${{ startsWith(inputs.bump, 'pre') && inputs.preid && format('--preid {0}', inputs.preid) || '' }}
6074 run : |
6175 git config --global user.name "github-actions[bot]"
6276 git config --global user.email "github-actions[bot]@users.noreply.github.com"
63- TAG=$(npm version ${{ github.event.inputs.bump }} -m "Release %s")
77+ TAG=$(npm version ${{ github.event.inputs.bump }} $PREID_FLAG -m "Release %s")
6478 echo "Created tag: $TAG"
6579 echo "tag=$TAG" >> "$GITHUB_OUTPUT"
6680
6781 - name : Push changes to master
68- if : ${{ !inputs.dry-run }}
82+ if : ${{ !inputs.dryRun }}
6983 run : |
7084 git push origin master --follow-tags
7185
7286 - name : Publish to npm
7387 env :
74- DRY_RUN_FLAG : ${{ inputs.dry-run && '--dry-run' || '' }}
75- run : npm publish --provenance --access=public $DRY_RUN_FLAG
88+ DRY_RUN_FLAG : ${{ inputs.dryRun && '--dry-run' || '' }}
89+ TAG_FLAG : ${{ startsWith(inputs.bump, 'pre') && format('--tag {0}', inputs.npmPreTag) || ''}}
90+ run : npm publish --provenance --access=public $DRY_RUN_FLAG $TAG_FLAG
7691
7792 - name : Create GitHub Release
78- if : ${{ !inputs.dry-run }}
93+ if : ${{ !inputs.dryRun }}
7994 uses : softprops/action-gh-release@v2
8095 with :
8196 tag_name : ${{ steps.bump-version.outputs.tag }}
0 commit comments