-
Notifications
You must be signed in to change notification settings - Fork 8
83 lines (72 loc) · 1.85 KB
/
commit.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
name: Commit CI
on:
push:
branches:
- '*'
paths-ignore:
- '**.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
# 拉取代码
- name: Checkout
uses: actions/checkout@v3
# 装 nodejs
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: latest
# 装 pnpm
- name: Install pnpm
uses: pnpm/action-setup@v2.3.0
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# 安装 go
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: ">=1.21.0"
check-latest: true
- name: Setup go cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build frontend
run: |
cd frontend
pnpm i
pnpm build
cd ..
# 编译
- name: Build
run: |
go mod tidy
go env -w GOARCH=amd64
echo "编译 windows 版本"
go env -w GOOS=windows
go build -o ./bin/rose.exe
# 上传到 Artifact
- name: Upload windows
uses: actions/upload-artifact@v4
with:
name: rose
path: ./bin/