File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish to npm
2+
3+ on :
4+ pull_request :
5+ types : [closed]
6+ branches :
7+ - production
8+
9+ jobs :
10+ publish :
11+ if : github.event.pull_request.merged == true
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v4
17+
18+ - name : Setup Node.js
19+ uses : actions/setup-node@v4
20+ with :
21+ node-version : ' 20'
22+ registry-url : ' https://registry.npmjs.org'
23+
24+ - name : Install dependencies
25+ run : npm ci
26+
27+ - name : Build
28+ run : npm run build
29+
30+ - name : Get package version
31+ id : pkg
32+ run : echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
33+
34+ - name : Publish to npm
35+ run : npm publish --access public
36+ env :
37+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
38+
39+ - name : Create GitHub release
40+ uses : softprops/action-gh-release@v2
41+ with :
42+ tag_name : v${{ steps.pkg.outputs.version }}
43+ name : v${{ steps.pkg.outputs.version }}
44+ body : |
45+ Published from PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}
46+ generate_release_notes : true
You can’t perform that action at this time.
0 commit comments