1111 - patch
1212 - minor
1313 - major
14- - custom
15- version :
16- description : " Custom version (e.g. v1.2.3, v0.1.2-beta.0) "
14+ prerelease :
15+ description : " Prerelease tag (e.g. beta, alpha) "
16+ required : false
1717 type : string
1818concurrency :
1919 group : ${{ github.workflow }}
@@ -34,28 +34,15 @@ jobs:
3434 run : |
3535 git config user.name "github-actions[bot]"
3636 git config user.email "github-actions[bot]@users.noreply.github.com"
37- - name : Validate inputs
38- run : |
39- if [[ "${{ github.event.inputs.increment }}" == "custom" ]]; then
40- VERSION="${{ github.event.inputs.version }}"
41- if [[ -z "$VERSION" ]]; then
42- echo "❌ A version is required with a custom increment"
43- exit 1
44- fi
45- if [[ ! "$VERSION" =~ ^v(\d+\.\d+\.\d+(?:-[a-z]+\.\d+)?)$ ]]; then
46- echo "❌ The provided version is not valid"
47- exit 1
48- fi
49- # Remove the "v" prefix and use as increment
50- INCREMENT="${VERSION:1}"
51- else
52- INCREMENT="${{ github.event.inputs.increment }}"
53- fi
54- echo "INCREMENT=$INCREMENT" >> $GITHUB_OUTPUT
5537 - name : Install dependencies
5638 run : npm ci
5739 - name : Release package
58- run : npm run release -- --increment "$INCREMENT" --ci
40+ run : |
41+ ARGS="${{ github.event.inputs.increment }} --ci"
42+ if [[ -n "${{ github.event.inputs.prerelease }}" ]]; then
43+ ARGS+=" --preRelease=${{ github.event.inputs.prerelease }}"
44+ fi
45+ npm run release -- $ARGS
5946 env :
6047 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
6148 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments