-
Notifications
You must be signed in to change notification settings - Fork 51
212 lines (178 loc) Β· 7.57 KB
/
Copy pathbuild-python.yml
File metadata and controls
212 lines (178 loc) Β· 7.57 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: Build Python
on:
workflow_dispatch:
permissions:
contents: read
jobs:
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Windows: x64, x86
# PyInstaller runs natively; architecture param selects the Python interpreter bitness.
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
build-windows:
name: Build Windows (${{ matrix.arch }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- arch: x64
python-arch: x64
output: Open_AG_Patcher_Windows_x64.exe
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python (${{ matrix.arch }})
uses: actions/setup-python@v6
with:
python-version: '3.x'
architecture: ${{ matrix.python-arch }}
- name: Install dependencies
run: pip install -r requirements.txt
working-directory: source
- name: Build with PyInstaller
run: >
pyinstaller --onefile
--uac-admin
--icon=icon.ico
--name="Open_AG_Patcher_Windows_x64"
--noupx
--clean
--version-file=version.txt
main.py
working-directory: source
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: python-windows-${{ matrix.arch }}
path: source/dist/${{ matrix.output }}
if-no-files-found: error
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Windows ARM64 β native windows-11-arm runner
# setup-python@v6 on ARM64 runners does not accept the 'architecture' param,
# so this target runs as a dedicated job.
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
build-windows-arm64:
name: Build Windows (arm64)
runs-on: windows-11-arm
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install dependencies
run: pip install -r requirements.txt
working-directory: source
- name: Build with PyInstaller
run: >
pyinstaller --onefile
--uac-admin
--icon=icon.ico
--name="Open_AG_Patcher_Windows_arm64"
--noupx
--clean
--version-file=version.txt
main.py
working-directory: source
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: python-windows-arm64
path: source/dist/Open_AG_Patcher_Windows_arm64.exe
if-no-files-found: error
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Linux x64
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
build-linux-x64:
name: Build Linux (x64)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install dependencies
run: pip install -r requirements.txt
working-directory: source
- name: Build with PyInstaller
run: >
pyinstaller --onefile
--icon=icon.ico
--name="Open_AG_Patcher_Linux_x64"
--hidden-import=packaging
--hidden-import=packaging.version
--hidden-import=packaging.specifiers
--hidden-import=packaging.requirements
--clean
main.py
working-directory: source
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: python-linux-x64
path: source/dist/Open_AG_Patcher_Linux_x64
if-no-files-found: error
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Linux ARM64 β via QEMU emulation
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
build-linux-arm64:
name: Build Linux (ARM64)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
with:
platforms: arm64
- name: Build inside ARM64 container
uses: docker/build-push-action@v7
with:
context: source
file: .github/.github-docker/Dockerfile.linux-arm64
platforms: linux/arm64
push: false
outputs: type=local,dest=source/dist-arm64
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: python-linux-arm64
path: source/dist-arm64/Open_AG_Patcher_Linux_arm64
if-no-files-found: error
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# macOS β universal2 binary (Intel + Apple Silicon in one file)
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
build-macos:
name: Build macOS (universal2)
runs-on: macos-15
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python (universal2 / arm64 host)
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install dependencies
run: pip install -r requirements.txt
working-directory: source
- name: Build with PyInstaller (universal2)
run: >
pyinstaller --onefile
--name="Open_AG_Patcher_macOS"
--target-arch universal2
--hidden-import=packaging
--hidden-import=packaging.version
--hidden-import=packaging.specifiers
--hidden-import=packaging.requirements
--clean
main.py
working-directory: source
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: python-macos-universal2
path: source/dist/Open_AG_Patcher_macOS
if-no-files-found: error