Skip to content

Commit b3099f7

Browse files
authored
chore: update gh workflows (#30)
1 parent 3a7b802 commit b3099f7

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
node-version: [19.x]
13+
node-version: [18, 20, 22]
1414
fail-fast: false
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818
- name: Use Node v${{ matrix.node-version }}
19-
uses: actions/setup-node@v2
19+
uses: actions/setup-node@v4
2020
with:
2121
node-version: ${{ matrix.node-version }}
2222
- name: Install Dependencies

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish Release (npm)
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- name: Setup Node
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
- name: Install Dependencies
18+
run: npm ci
19+
- name: Lint
20+
run: npm run lint
21+
- name: Build
22+
run: npm run build
23+
- name: Test
24+
run: npm test
25+
26+
publish-npm:
27+
needs: build
28+
runs-on: ubuntu-latest
29+
permissions:
30+
id-token: write
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: actions/setup-node@v4
36+
with:
37+
node-version: 22.x
38+
registry-url: 'https://registry.npmjs.org'
39+
cache: 'npm'
40+
- run: npm ci
41+
- run: npm version ${TAG_NAME} --git-tag-version=false
42+
env:
43+
TAG_NAME: ${{ github.ref_name }}
44+
- run: npm publish --provenance --access public --tag next
45+
if: "github.event.release.prerelease"
46+
- run: npm publish --provenance --access public
47+
if: "!github.event.release.prerelease"

0 commit comments

Comments
 (0)