Skip to content

Commit bd60738

Browse files
committed
polish pass over current GitHub actions
1 parent 05f9817 commit bd60738

File tree

3 files changed

+36
-10
lines changed

3 files changed

+36
-10
lines changed

.github/workflows/main-ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2-
# This workflow will protect the main branch by testing and linting new PRs and commits
2+
# This workflow will protect the main branch by testing and linting new commits
33

44
name: Main CI
55

66
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
77
on:
88
push:
9-
branches:
10-
- main
9+
branches: [main]
1110

1211
jobs:
1312
test:
@@ -24,7 +23,7 @@ jobs:
2423
- uses: actions/setup-node@v4
2524
with:
2625
node-version: ${{ matrix.node-version }}
27-
cache: "npm"
26+
cache: npm
2827
- run: npm ci --package-lock
2928
- run: npm test
3029

@@ -35,6 +34,6 @@ jobs:
3534
- uses: actions/setup-node@v4
3635
with:
3736
node-version: 18
38-
cache: "npm"
37+
cache: npm
3938
- run: npm ci --package-lock
4039
- run: npm run lint:ci

.github/workflows/main-pr.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2-
# This workflow will protect the main branch by testing and linting new PRs and commits
2+
# This workflow will protect the main branch by testing and linting new PRs
33

44
name: Main PR
55

66
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
77
on:
88
pull_request:
9-
branches:
10-
- main
9+
branches: [main]
1110

1211
jobs:
1312
test:
@@ -24,7 +23,7 @@ jobs:
2423
- uses: actions/setup-node@v4
2524
with:
2625
node-version: ${{ matrix.node-version }}
27-
cache: "npm"
26+
cache: npm
2827
- run: npm ci --package-lock
2928
- run: npm test
3029

@@ -35,6 +34,6 @@ jobs:
3534
- uses: actions/setup-node@v4
3635
with:
3736
node-version: 18
38-
cache: "npm"
37+
cache: npm
3938
- run: npm ci --package-lock
4039
- run: npm run lint:ci
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2+
# This workflow will publish any new release to the npmjs registry
3+
4+
name: Publish Release
5+
6+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
7+
on:
8+
workflow_dispatch:
9+
release:
10+
types: [released]
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 18
20+
cache: npm
21+
# NOTE: the explicit registry-url is currently needed for the auth token to work
22+
registry-url: https://registry.npmjs.org/
23+
- run: npm ci --package-lock
24+
- run: npm test
25+
- run: npm run lint:ci
26+
- run: npm publish --access public
27+
env:
28+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 commit comments

Comments
 (0)