1 | name: Publish to NPM
|
2 | on:
|
3 | release:
|
4 | types: [published]
|
5 | jobs:
|
6 | publish:
|
7 | runs-on: ubuntu-latest
|
8 | steps:
|
9 | - name: Checkout
|
10 | uses: actions/checkout@v2
|
11 | - uses: actions/setup-node@v2
|
12 | with:
|
13 | node-version: 16
|
14 | registry-url: https://registry.npmjs.org
|
15 | - name: Check node_modules cache
|
16 | uses: actions/cache@v2
|
17 | id: yarn-cache
|
18 | with:
|
19 | path: '**/node_modules'
|
20 | key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
21 | - name: Install dependencies
|
22 | if: steps.yarn-cache.outputs.cache-hit != 'true'
|
23 | run: yarn install --frozen-lockfile
|
24 | - name: Version
|
25 | run: yarn version --new-version "${GITHUB_REF:11}" --no-git-tag-version
|
26 | - name: Publish
|
27 | run: yarn publish --access public
|
28 | env:
|
29 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|