66 description : ' Version'
77 type : choice
88 required : true
9- default : patch
9+ default : fix
1010 options :
11- - patch
12- - minor
13- - major
14- dryrun :
11+ - fix
12+ - feat
13+ - BREAKING CHANGE
14+ dryRun :
1515 description : ' DryRun'
16- required : true
17- default : ' false'
16+ type : boolean
17+ default : true
18+ # ENV and Config
19+ env :
20+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
21+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
22+ GIT_AUTHOR_NAME : github-actions
23+ GIT_AUTHOR_EMAIL :
[email protected] 24+ GIT_COMMITTER_NAME : github-actions
25+ GIT_COMMITTER_EMAIL :
[email protected] 26+ CI : true
27+ CONFIG_NODE_VERSION : ' ["18.x"]'
28+ CONFIG_OS : ' ["ubuntu-latest"]'
29+ # Main Job
1830jobs :
31+ config :
32+ runs-on : ubuntu-latest
33+ outputs :
34+ NODE_VERSION : ${{ steps.set-config.outputs.CONFIG_NODE_VERSION }}
35+ OS : ${{ steps.set-config.outputs.CONFIG_OS }}
36+ steps :
37+ - id : set-config
38+ run : |
39+ echo "CONFIG_NODE_VERSION=${{ toJSON(env.CONFIG_NODE_VERSION) }}" >> $GITHUB_OUTPUT
40+ echo "CONFIG_OS=${{ toJSON(env.CONFIG_OS) }}" >> $GITHUB_OUTPUT
1941 release :
20- name : Test, Build and Release
21- runs-on : ${{ matrix.os }}
42+ name : Test, Build and force Release
43+ needs : config
44+
45+ runs-on : ${{ matrix.OS }}
2246 strategy :
2347 matrix :
24- os : [ ubuntu-latest ]
25- node-version : [ 16.x ]
48+ OS : ${{ fromJSON(needs.config.outputs.OS) }}
49+ NODE_VERSION : ${{ fromJSON(needs.config.outputs.NODE_VERSION) }}
50+
2651 steps :
27- - name : Checkout
52+ - name : Checkout repo
2853 uses : actions/checkout@v3
29- - name : Setup Node.js
54+ - name : Setup Node.js ${{ matrix.NODE_VERSION }}
3055 uses : actions/setup-node@v3
3156 with :
32- node-version : ${{ matrix['node-version'] }}
57+ node-version : ${{ matrix.NODE_VERSION }}
3358 - name : Commit trigger
3459 run : |
35- git commit --allow-empty -m "${{ github.event.inputs.version }}: Trigger Manual Release"
60+ git commit --allow-empty -m "${{ github.event.inputs.version }}: Trigger Manual Release
61+
62+ ${{ github.event.inputs.version }}:Forced Manual Release without code changes"
3663 - name : Install dependencies
3764 run : npm ci
3865 - name : Build Library
3966 run : npm run build --if-present
4067 - name : Run Tests
4168 run : npm test --if-present
42- - name : Release
69+ - name : Publish npm package
4370 uses : cycjimmy/semantic-release-action@v3
4471 with :
45- dry_run : ${{ github.event.inputs.dryrun == 'true' }}
72+ dry_run : ${{ github.event.inputs.dryRun == 'true' }}
4673 extra_plugins : |
4774 @semantic-release/changelog
4875 @semantic-release/git
49- env :
50- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
51- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
52- GIT_AUTHOR_NAME : github-actions
53- GIT_AUTHOR_EMAIL :
[email protected] 54- GIT_COMMITTER_NAME : github-actions
55- GIT_COMMITTER_EMAIL :
[email protected] 56- CI : true
0 commit comments