forked from xpf0000/FlyEnv
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (70 loc) · 2.12 KB
/
main.yml
File metadata and controls
81 lines (70 loc) · 2.12 KB
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
name: Build FlyEnv Windows Packages
on:
push:
paths:
- 'build/windows.build.yml'
jobs:
build-windows:
name: Build Windows Packages (x64)
runs-on: windows-2022
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install build dependencies
run: |
# 安装必要的构建工具
choco install -y make
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: 'src/helper-go/go.mod'
cache-dependency-path: 'src/helper-go/go.sum'
- name: Cache node_modules and node-gyp
uses: actions/cache@v4
with:
path: |
node_modules
**/node_modules
.yarn/cache
~/.cache/node-gyp
~\AppData\Local\node-gyp
key: ${{ runner.os }}-x64-node-${{ hashFiles('**/package.json') }}
- name: Install Yarn and build tools
run: |
npm install -g yarn node-gyp
python -m pip install --upgrade pip
- name: Install dependencies with Yarn
run: |
# Force link against WinRT runtime objects
$env:LINK = "runtimeobject.lib"
yarn install
- name: Build Go helper with build-win.ps1
run: |
go install github.com/tc-hib/go-winres@latest
$GOBIN = $(go env GOPATH) + "\bin"
$env:PATH = "$GOBIN;$env:PATH"
cd "$env:GITHUB_WORKSPACE/src/helper-go"
go mod download
go-winres make
# 使用 PowerShell 脚本构建
.\build-win.ps1
- name: Build Electron packages with electron-builder
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd "$env:GITHUB_WORKSPACE"
yarn build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: FlyEnv-Windows-x64
path: |
release/*.exe
release/*.msi
release/*.yml
release/*.blockmap-