Skip to content

Commit 41c416d

Browse files
committed
ci: update workflow
1 parent 10d8cdf commit 41c416d

File tree

1 file changed

+32
-63
lines changed

1 file changed

+32
-63
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,57 @@
1-
name: Release
2-
on: [push]
3-
4-
env:
5-
CI: true
1+
name: validate
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
- reopened
612

713
jobs:
8-
lint:
9-
name: Lint codebase
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: Checkout repo
13-
uses: actions/checkout@v4
14-
15-
- uses: pnpm/action-setup@v3
16-
name: Install pnpm
17-
id: pnpm-install
18-
19-
- name: Set up Node.js
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: 20
23-
cache: "pnpm"
24-
25-
- name: Run PNPM install
26-
run: pnpm install --frozen-lockfile
27-
28-
- name: Lint
29-
run: pnpm lint
30-
31-
build:
32-
name: Build, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
33-
runs-on: ${{ matrix.os }}
34-
needs: lint
14+
validate:
15+
name: Validate on Node ${{ matrix.node }}
16+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
3517
strategy:
3618
matrix:
37-
node: ["18.x", "20.x"]
38-
os: [ubuntu-latest]
39-
19+
node: ["20.x", "22.x"]
20+
runs-on: "ubuntu-latest"
21+
env:
22+
CI: true
4023
steps:
4124
- name: Checkout repo
42-
uses: actions/checkout@v3
43-
44-
- uses: pnpm/action-setup@v3
45-
name: Install pnpm
46-
id: pnpm-install
25+
uses: actions/checkout@v4
4726

48-
- name: Use Node ${{ matrix.node }}
49-
uses: actions/setup-node@v4
27+
- name: Set up Node.js
28+
uses: labd/gh-actions-typescript/pnpm-install@main
5029
with:
5130
node-version: ${{ matrix.node }}
52-
cache: "pnpm"
5331

54-
- name: Run PNPM install
55-
run: pnpm install --frozen-lockfile
32+
- name: Check formatting and typing
33+
run: pnpm check
5634

57-
- name: Test
35+
- name: Run tests
5836
run: pnpm test:ci
5937

60-
- name: Build
38+
- name: Run build
6139
run: pnpm build
6240

6341
release:
6442
timeout-minutes: 15
6543
runs-on: ubuntu-latest
66-
if: github.ref == 'refs/heads/main'
67-
needs: build
44+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
45+
needs: validate
6846
steps:
69-
- name: Checkout
47+
- name: Checkout repo
7048
uses: actions/checkout@v4
71-
with:
72-
fetch-depth: 0
73-
74-
- uses: pnpm/action-setup@v3
75-
name: Install pnpm
76-
id: pnpm-install
7749

78-
- name: Install node.js
79-
uses: actions/setup-node@v4
80-
with:
81-
node-version: 20
82-
cache: "pnpm"
50+
- name: Set up Node.js
51+
uses: labd/gh-actions-typescript/pnpm-install@main
8352

84-
- name: Run PNPM install
85-
run: pnpm install --frozen-lockfile
53+
- name: Run build
54+
run: pnpm build
8655

8756
- name: Create and publish versions
8857
uses: changesets/action@v1

0 commit comments

Comments
 (0)