-
-
Notifications
You must be signed in to change notification settings - Fork 10
80 lines (64 loc) · 1.75 KB
/
ci.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
name: CI
on:
push:
branches:
- 'main'
concurrency:
group: ${{ github.workflow }}
# 很烦: 通知无法关掉
# cancel-in-progress: true
jobs:
ghd:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
describe: ${{ steps.ghd.outputs.describe }}
tag: ${{ steps.ghd.outputs.tag }}
distance: ${{ steps.ghd.outputs.distance }}
sha: ${{ steps.ghd.outputs.sha }}
steps:
- name: Git describe
id: ghd
uses: proudust/gh-describe@v2
test-and-build:
runs-on: ubuntu-latest
# git describe
needs: ghd
env:
RELEASE_NIGHTLY: 'true'
GHD_DESCRIBE: ${{ needs.ghd.outputs.describe }}
GHD_TAG: ${{ needs.ghd.outputs.tag }}
GHD_DISTANCE: ${{ needs.ghd.outputs.distance }}
GHD_SHA: ${{ needs.ghd.outputs.sha }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
# install deps
- run: pnpm install --frozen-lockfile
# turbo cache
- uses: actions/cache@v4
with:
path: node_modules/.cache/turbo
key: turbo-cache-${{ runner.os }}
# code check
- run: pnpm turbo build:scss typecheck
# test
- run: pnpm test
# run knip report
- run: pnpm knip
continue-on-error: true
# build
- run: pnpm build:real-build
# prepare
- run: cp README.md CHANGELOG.md ./dist
# commit to release-nightly branch
- uses: peaceiris/actions-gh-pages@v4
with:
publish_branch: release-nightly
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
force_orphan: true