File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Release
22
33on :
4- # push:
5- # branches: [main]
6-
74 workflow_dispatch :
85 inputs :
96 dry-run :
@@ -30,9 +27,44 @@ concurrency:
3027
3128
3229jobs :
33- release :
34- uses : cap-js/.github/.github/workflows/release.yml@main
35- secrets : inherit
36- with :
37- dry-run : ${{ github.event.inputs.dry-run == 'true' }}
38- tag : ${{ github.event.inputs.tag || 'latest'}}
30+ publish-npm :
31+ runs-on : ubuntu-latest
32+ environment : npm
33+ steps :
34+ - uses : actions/checkout@v4
35+
36+ - uses : actions/setup-node@v4
37+ with :
38+ node-version : 22
39+ registry-url : https://registry.npmjs.org/
40+
41+ - name : Run Unit Tests
42+ run : |
43+ npm ci
44+ npm run test
45+
46+ - name : Run Build
47+ run : npm run build
48+
49+ - name : Publish to npm
50+ run : npm publish --tag ${{ github.event.inputs.tag || 'latest' }} --access public --provenance ${{ github.event.inputs.dry-run == 'true' && '--dry-run' || '' }}
51+ env :
52+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
53+
54+ - name : Get Version
55+ id : get-version
56+ run : |
57+ echo "version=$(npm pkg get version | tr -d '"')" >> $GITHUB_OUTPUT
58+
59+ - name : Parse CHANGELOG.md
60+ id : parse-changelog
61+ uses : schwma/parse-changelog-action@v1.0.0
62+ with :
63+ version : ' ${{ steps.get-version.outputs.version }}'
64+ title-regex : ' ^##\s+\[\d.*$'
65+
66+ - name : Create a GitHub release
67+ if : ${{ github.event.inputs.dry-run != 'true' }}
68+ uses : ncipollo/release-action@v1
69+ with :
70+ tag : ' v${{ steps.get-version.outputs.version }}'
You can’t perform that action at this time.
0 commit comments