Skip to content

Commit 2d17df7

Browse files
committed
feat: update workflows, add release workflow
1 parent b611620 commit 2d17df7

2 files changed

Lines changed: 45 additions & 13 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1-
name: 'GitHub Actions'
1+
name: CI
22

33
on:
44
push:
55
branches:
6-
- master
6+
- master
77
pull_request:
88

99
jobs:
1010
tests:
11-
name: 'tests'
12-
runs-on: ubuntu-20.04
13-
11+
name: tests
12+
runs-on: ubuntu-latest
1413
steps:
15-
- uses: actions/checkout@v2
16-
- uses: bahmutov/npm-install@v1
17-
- run: npm test
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 18
18+
cache: npm
19+
- run: npm ci
20+
- run: npm test
1821

1922
prettier:
20-
name: 'prettier'
21-
runs-on: ubuntu-20.04
22-
23+
name: prettier
24+
runs-on: ubuntu-latest
2325
steps:
24-
- uses: actions/checkout@v2
25-
- uses: bahmutov/npm-install@v1
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 18
30+
cache: npm
31+
- run: npm ci
2632
- run: npm run fmt:check

‎.github/workflows/release.yml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
name: build & publish
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 18
17+
cache: npm
18+
registry-url: https://registry.npmjs.org
19+
20+
- run: npm ci
21+
- run: npm test
22+
- run: npm run build
23+
24+
- run: npm publish --access public
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)