Skip to content

Commit 26188cb

Browse files
committed
ci: publish job
1 parent b7e679d commit 26188cb

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

.github/workflows/build.yml

+31-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
node-version: [ latest, 14, 16, 18 ]
21+
node-version: [ latest, 14, 16, 18, "lts/*" ]
2222
steps:
2323
# Checkout
2424
- name: Checkout
@@ -40,11 +40,6 @@ jobs:
4040
npm run build
4141
npm run test:ci
4242
43-
# Publish
44-
- name: Publish
45-
if: ${{ github.ref_type == 'tag' }}
46-
run: npm publish
47-
4843
build-all:
4944
name: Build
5045
runs-on: ubuntu-latest
@@ -53,3 +48,33 @@ jobs:
5348
needs: [ build ]
5449
steps:
5550
- run: echo OK
51+
52+
publish:
53+
name: Publish
54+
if: github.ref_type == 'tag'
55+
runs-on: ubuntu-latest
56+
permissions:
57+
contents: read
58+
needs: [ build-all ]
59+
steps:
60+
# Checkout
61+
- name: Checkout
62+
uses: actions/checkout@v3
63+
64+
# Setup
65+
- name: Setup node
66+
uses: actions/setup-node@v3
67+
with:
68+
node-version: lts/*
69+
cache: npm
70+
registry-url: 'https://registry.npmjs.org'
71+
72+
# Dependencies
73+
- name: Install dependencies
74+
run: npm ci
75+
76+
# Publish
77+
- name: Publish
78+
run: npm publish
79+
env:
80+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)