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 : npm publish
2+ on :
3+ release :
4+ types : [published]
5+ jobs :
6+ build :
7+ runs-on : ubuntu-latest
8+ steps :
9+ - uses : actions/checkout@v3
10+ - id : get-nvmrc
11+ run : echo VERSION=$(cat .nvmrc) >> $GITHUB_OUTPUT
12+ - id : get-tag
13+ run : |
14+ if [[ $GITHUB_REF =~ [0-9]+.[0-9]+.[0-9]+$ ]]; then
15+ echo TAG=latest >> $GITHUB_OUTPUT
16+ else
17+ echo TAG=beta >> $GITHUB_OUTPUT
18+ fi
19+ - uses : actions/setup-node@v3
20+ with :
21+ registry-url : https://registry.npmjs.org
22+ node-version : ${{ steps.get-nvmrc.outputs.VERSION }}
23+ - run : npm ci
24+ env :
25+ NODE_AUTH_TOKEN : ${{ secrets.NPM_REGISTRY_KEY }}
26+ - run : npm run test
27+ - run : npm run build
28+ - run : npm version ${{ github.event.release.tag_name }} --no-git-tag-version
29+ - run : npm publish --tag ${{ steps.get-tag.outputs.TAG }}
30+ env :
31+ NODE_AUTH_TOKEN : ${{ secrets.NPM_REGISTRY_KEY }}
You can’t perform that action at this time.
0 commit comments