File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed
Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+ name : Node.js Package
5+
6+ on :
7+ release :
8+ types : [created]
9+
10+ jobs :
11+ build :
12+ name : Verify
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v4
17+ with :
18+ fetch-depth : 0
19+ - name : Setup Nodejs Env
20+ run : echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
21+ - name : Setup Node.js
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : ${{ env.NODE_VER }}
25+ - name : Install dependencies
26+ run : npm ci
27+ - name : Lint
28+ run : npm run lint
29+ - name : Test
30+ run : npm run test
31+
32+ publish-npm :
33+ needs : build
34+ runs-on : ubuntu-latest
35+ steps :
36+ - name : Checkout
37+ uses : actions/checkout@v4
38+ with :
39+ fetch-depth : 0
40+ - name : Setup Nodejs Env
41+ run : echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
42+ - name : Setup Node.js
43+ uses : actions/setup-node@v4
44+ with :
45+ node-version : ${{ env.NODE_VER }}
46+ registry-url : ' https://registry.npmjs.org'
47+ - run : npm ci
48+ - run : git config --global user.name "${{ github.actor }}"
49+ - run : git config --global user.email "github-action-${{ github.actor }}@users.noreply.github.com"
50+ - run : npm version --no-git-tag-version ${{ github.event.release.tag_name }}
51+ - run : npm run build
52+ - run : npm publish --access public
53+ env :
54+ NODE_AUTH_TOKEN : ${{secrets.SEMANTIC_RELEASE_NPM_TOKEN}}
You can’t perform that action at this time.
0 commit comments