Skip to content

Commit 09b22f7

Browse files
authored
Improve CI scripts (#101)
2 parents a82093c + aaffdbf commit 09b22f7

File tree

3 files changed

+53
-11
lines changed

3 files changed

+53
-11
lines changed

.github/workflows/publish.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Set up pnpm
19+
uses: pnpm/action-setup@v2
20+
with:
21+
version: 8
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
registry-url: "https://registry.npmjs.org"
27+
cache: pnpm
28+
- name: Install dependencies
29+
run: pnpm install --ignore-scripts
30+
- name: Build
31+
run: pnpm run build
32+
- name: Publish to NPM (with provenance)
33+
run: pnpm publish --no-git-checks --access public --tag ${{ github.event.release.prerelease && 'next' || 'latest' }}
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
NPM_CONFIG_PROVENANCE: "true"

.github/workflows/size.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Size Limit
2+
23
on:
34
pull_request:
45
branches:
@@ -15,16 +16,16 @@ jobs:
1516

1617
steps:
1718
- uses: actions/checkout@v4
19+
- name: Fetch Git refs
20+
run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
1821
- uses: pnpm/action-setup@v2
1922
with:
20-
version: latest
23+
version: 8
2124
- uses: actions/setup-node@v4
2225
with:
2326
node-version: 20
2427
cache: pnpm
25-
- name: Install dependencies
26-
run: pnpm install --ignore-scripts
27-
- name: Check size
28+
- name: Check package size
2829
uses: andresz1/size-limit-action@v1
2930
with:
3031
github_token: ${{ secrets.GITHUB_TOKEN }}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Lint
1+
name: Test
2+
23
on:
34
push:
45
branches:
@@ -7,22 +8,26 @@ on:
78
branches:
89
- main
910

11+
env:
12+
FORCE_COLOR: 2
13+
1014
jobs:
11-
lint:
15+
test:
1216
runs-on: ubuntu-latest
13-
env:
14-
FORCE_COLOR: 2
1517

1618
steps:
1719
- uses: actions/checkout@v4
1820
- uses: pnpm/action-setup@v2
1921
with:
20-
version: latest
22+
version: 8
2123
- uses: actions/setup-node@v4
2224
with:
2325
node-version: 20
2426
cache: pnpm
2527
- name: Install dependencies
2628
run: pnpm install --ignore-scripts
27-
- name: Lint
28-
run: pnpm lint
29+
# pre-commit dioes this for us
30+
# - name: Lint
31+
# run: pnpm run lint
32+
- name: Build
33+
run: pnpm run build

0 commit comments

Comments
 (0)