-
Notifications
You must be signed in to change notification settings - Fork 20
109 lines (91 loc) · 2.84 KB
/
build-test.yml
File metadata and controls
109 lines (91 loc) · 2.84 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Buildup Test
on:
pull_request:
branches:
- main
workflow_dispatch: # 允许手动触发工作流
jobs:
build-main-files:
runs-on: windows-latest # 使用最新的 Windows 运行器
steps:
# 检出仓库代码
- name: Checkout repository
uses: actions/checkout@v3
# 设置 Python 3.11 环境
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
# 安装依赖和 Nuitka
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python --version
shell: cmd
# 进行编译
- name: Run Compile
run: |
python -m nuitka --windows-file-version=0.0.0.0 --show-progress --mingw64 --assume-yes-for-downloads --output-dir=out main/Boss-Key.py
# 添加版本信息到可执行文件并重命名
- name: Add version information and rename executable
shell: pwsh
run: |
# 获取标签名作为版本号,去除前缀 refs/tags/
$tag = 'Build-Test'
# 定义新的文件名
$newExeName = "Boss-Key-$tag-onefile.exe"
# 重命名可执行文件
Rename-Item "out/Boss-Key.exe" $newExeName
# 压缩out/Boss-Key.dist/文件夹
Compress-Archive -Path "out/Boss-Key.dist" -DestinationPath "out/Boss-Key-$tag-multifile.zip"
ls out
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Build-Test-Build
path: |
out/Boss-Key.dist
deploy-test:
environment:
name: buildup-test
runs-on: windows-2022
needs: build-main-files
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Build-Test-Build
path: ./test
- name: Test Main Files
run: |
cd ./test
dir
./Boss-Key.exe
compile-to-installer:
runs-on: windows-latest
needs: deploy-test
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Clone Repo
run: |
cd ./.github/inno-script
git clone https://github.com/IvanHanloth/innosetup-action.git
cp -r innosetup-action/* .
dir
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Build-Test-Build
path: ./.github/inno-script/software
- name: Compile Installer
run: |
dir
.\ISCC.exe /DMyAppVersion='Build-Test' Boss-Key.iss
working-directory: .github/inno-script
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: Boss-Key-Installer
path: .github/inno-script/output/Boss-Key-Build-Test-Installer.exe