Skip to content

Commit fcfef33

Browse files
committed
fix: tweak CI
1 parent 5435d47 commit fcfef33

File tree

1 file changed

+25
-28
lines changed

1 file changed

+25
-28
lines changed

.github/workflows/publish-node.js.yml

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
11
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
4-
name: Publish
3+
name: Publish npm Package
54

65
on:
7-
release:
8-
types: [published]
9-
jobs:
10-
publish:
6+
push:
7+
branches:
8+
- master
119

10+
jobs:
11+
publish-npm:
1212
runs-on: ubuntu-latest
13-
1413
steps:
15-
- uses: actions/checkout@v3
16-
with:
17-
ref: ${{ github.event.release.target_commitish }}
18-
- uses: actions/setup-node@v3
19-
with:
20-
node-version: 20
21-
cache: 'npm'
22-
- run: git config --global user.name "GitHub CD bot"
23-
- run: git config --global user.email "[email protected]"
24-
- run: npm version ${{ github.event.release.tag_name }}
25-
- run: npm i
26-
- run: export NODE_OPTIONS=--openssl-legacy-provider && npm run build
27-
- uses: JS-DevTools/npm-publish@v1
28-
with:
29-
token: ${{ secrets.NPM_TOKEN }}
30-
31-
# push the version changes to GitHub
32-
- run: git push
33-
env:
34-
# The secret is passed automatically. Nothing to configure.
35-
github-token: ${{ secrets.GITHUB_TOKEN }}
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 20
18+
registry-url: https://registry.npmjs.org/
19+
- run: git config --global user.name "GitHub CD bot"
20+
- run: git config --global user.email "[email protected]"
21+
- name: Install deps
22+
run: npm i
23+
- name: Build the app
24+
run: export NODE_OPTIONS=--openssl-legacy-provider && npm run build
25+
- run: npx semantic-release
26+
env:
27+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28+
# push the version changes to GitHub
29+
- run: git push
30+
env:
31+
# The secret is passed automatically. Nothing to configure.
32+
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)