Skip to content

Commit 5627423

Browse files
authored
chore(release): generate releases and provenance via workflow (#32)
1 parent 4edcb20 commit 5627423

File tree

3 files changed

+43
-4
lines changed

3 files changed

+43
-4
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- name: Checkout
15+
uses: actions/checkout@v3
1516

16-
- uses: pnpm/[email protected]
17+
- name: Install pnpm
18+
uses: pnpm/[email protected]
1719

18-
- uses: actions/setup-node@v2
20+
- name: Setup node
21+
uses: actions/setup-node@v2
1922
with:
20-
node-version: 16
23+
node-version: 18.x
24+
registry-url: https://registry.npmjs.org/
2125
cache: "pnpm"
2226

2327
- name: Install dependencies

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Install pnpm
18+
uses: pnpm/[email protected]
19+
20+
- name: Setup node
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: 18.x
24+
registry-url: https://registry.npmjs.org/
25+
cache: "pnpm"
26+
27+
- name: Install dependencies
28+
run: pnpm install
29+
30+
- name: Publish package
31+
run: pnpm publish --access public --no-git-checks
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
34+
NPM_CONFIG_PROVENANCE: true

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"format": "prettier --write .",
2121
"format:check": "prettier --check .",
2222
"prepare": "husky install",
23+
"prepublishOnly": "pnpm run build",
2324
"release": "standard-version --sign",
2425
"test:playground": "playwright test",
2526
"test:playground:ui": "pnpm run test:playground --ui"

0 commit comments

Comments
 (0)