-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (75 loc) · 1.87 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
on:
push:
branches:
- main
- '[0-9]+.[0-9]+.x'
- '[0-9]+.x.x'
- '[0-9]+.x'
- next
- next-major
- alpha
- beta
pull_request:
branches:
- main
- '[0-9]+.[0-9]+.x'
- '[0-9]+.x.x'
- '[0-9]+.x'
- next
- next-major
- alpha
- beta
concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 21.x]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile --prefer-offline --reporter=append-only
- run: pnpm run lint
- run: pnpm run build
- run: pnpm run test
- uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.node-version }}
path: |
*/dist
publish:
if: github.ref_name == 'main'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
- uses: actions/download-artifact@v4
with:
name: dist-20.x
path: .
- run: pnpm install --frozen-lockfile --prefer-offline --reporter=append-only
- uses: changesets/action@v1
with:
commit: "chore: update versions"
title: "chore: release"
publish: "pnpm run ci:publish"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}