Skip to content

Commit 2e4eedc

Browse files
committed
Add publish workflow
1 parent 56ec9be commit 2e4eedc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
- main
55

66
pull_request:
7+
release:
8+
types: [published]
79

810
jobs:
911
build:
@@ -21,3 +23,30 @@ jobs:
2123
# - run: npm ci
2224
- run: npm install --no-package-lock
2325
- run: npm run build
26+
27+
publish:
28+
runs-on: ubuntu-latest
29+
if: github.event_name == 'release'
30+
environment: release
31+
needs: build
32+
33+
permissions:
34+
contents: read
35+
id-token: write
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: 18
42+
cache: npm
43+
registry-url: "https://registry.npmjs.org"
44+
45+
# Working around https://github.com/npm/cli/issues/4828
46+
# - run: npm ci
47+
- run: npm install --no-package-lock
48+
49+
# TODO: Add --provenance once the repo is public
50+
- run: npm run publish-all
51+
env:
52+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)