Skip to content

Commit 8a9deb5

Browse files
committed
Update publish action.
1 parent 9bf5c0a commit 8a9deb5

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,30 @@ name: Publish new versions to registry
33
on:
44
create:
55
tags:
6-
- 'v[0-9]+.[0-9]+.[0-9]+-**'
6+
- "v[0-9]+.[0-9]+.[0-9]+-**"
77

88
jobs:
99
publish:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
14-
- name: Read .nvmrc
15-
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
16-
id: nvm
12+
- uses: actions/checkout@v3
1713

1814
- name: Setup node
19-
uses: actions/setup-node@v1
15+
uses: actions/setup-node@v3
2016
with:
21-
node-version: '${{ steps.nvm.outputs.NVMRC }}'
22-
registry-url: 'https://registry.npmjs.org'
23-
24-
- name: Cache node modules
25-
uses: actions/cache@v2
26-
env:
27-
cache-name: cache-node-modules
17+
node-version-file: ".nvmrc"
18+
registry-url: "https://registry.npmjs.org"
19+
20+
- name: Get npm cache directory
21+
id: npm-cache-dir
22+
run: |
23+
echo "::set-output name=dir::$(npm config get cache)"
24+
- uses: actions/cache@v3
2825
with:
29-
path: ~/.npm
30-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
26+
path: ${{ steps.npm-cache-dir.outputs.dir }}
27+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
3128
restore-keys: |
32-
${{ runner.os }}-build-${{ env.cache-name }}-
33-
${{ runner.os }}-build-
34-
${{ runner.os }}-
29+
${{ runner.os }}-node-
3530
3631
- name: Install dependencies
3732
run: npm i

0 commit comments

Comments
 (0)