-
Notifications
You must be signed in to change notification settings - Fork 10
274 lines (272 loc) · 9.97 KB
/
build.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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
name: build
on:
workflow_dispatch:
push:
branches:
- master
jobs:
build-windows:
runs-on: windows-latest
env:
PYTHONIOENCODING: utf-8
PYTHONOPTIMIZE: 1
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: requirements.txt
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Cache nuitka dependencies
uses: actions/cache@v3
with:
path: ~/AppData/Local/Nuitka/Nuitka/Cache
key: windows-nuitka
- name: Install pip dependencies
run: |
pip install -U -r requirements.txt
pip install -U nuitka zstandard ordered-set
- name: Build executable
run: |
'COMMIT_HASH = "' + (git rev-parse HEAD) + '"' | Out-File -Encoding ascii xdnmb/version.py
nuitka --standalone --assume-yes-for-downloads main.py
mv main.dist/main.exe main.dist/xdcmd.exe
rm -r main.dist/zstandard -ErrorAction SilentlyContinue
rm main.dist/api-ms-win-*.dll -ErrorAction SilentlyContinue
rm main.dist/ucrtbase.dll -ErrorAction SilentlyContinue
rm main.dist/_asyncio.pyd -ErrorAction SilentlyContinue
rm main.dist/_bz2.pyd -ErrorAction SilentlyContinue
rm main.dist/_decimal.pyd -ErrorAction SilentlyContinue
rm main.dist/_elementtree.pyd -ErrorAction SilentlyContinue
rm main.dist/_hashlib.pyd -ErrorAction SilentlyContinue
rm main.dist/_lzma.pyd -ErrorAction SilentlyContinue
rm main.dist/_multiprocessing.pyd -ErrorAction SilentlyContinue
rm main.dist/_queue.pyd -ErrorAction SilentlyContinue
rm main.dist/_uuid.pyd -ErrorAction SilentlyContinue
cp README.md main.dist/README.md
- name: Upload result
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xdcmd-windows
path: main.dist
- name: Setup UPX
run: choco install --no-progress upx
- name: Compress with UPX
run: |
foreach ($f in (Get-ChildItem -Include ("*.pyd", "*.dll", "*.exe") -Exclude "vcruntime140.dll" -Recurse "main.dist")) {
upx --ultra-brute --no-progress $f.FullName
}
- name: Upload result (upx)
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xdcmd-windows-upx
path: main.dist
- name: Build executable (onefile)
run: |
nuitka --standalone --onefile --assume-yes-for-downloads --output-filename=xdcmd.exe main.py
- name: Upload result (onefile)
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xdcmd-windows-onefile
path: |
xdcmd.exe
README.md
build-ubuntu:
runs-on: ubuntu-latest
env:
PYTHONIOENCODING: utf-8
PYTHONOPTIMIZE: 1
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: requirements.txt
- name: Cache nuitka dependencies
uses: actions/cache@v3
with:
path: ~/.cache/Nuitka
key: ubuntu-nuitka
- name: Install pip dependencies
run: |
pip install -U -r requirements.txt
pip install -U nuitka zstandard ordered-set
sudo apt install patchelf ccache
- name: Build executable
run: |
echo COMMIT_HASH = \"$(git rev-parse HEAD)\" > xdnmb/version.py
python3 -m nuitka --standalone --assume-yes-for-downloads main.py
mv main.dist/main.bin main.dist/xdcmd
chmod +x main.dist/xdcmd
rm -rf main.dist/zstandard
rm -f main.dist/audioop.so
rm -f main.dist/_asyncio.so
rm -f main.dist/_bisect.so
rm -f main.dist/_bz2.so
rm -f main.dist/_codecs_*.so
rm -f main.dist/_crypt.so
rm -f main.dist/_csv.so
rm -f main.dist/_ctypes.so
rm -f main.dist/_datetime.so
rm -f main.dist/_dbm.so
rm -f main.dist/_decimal.so
rm -f main.dist/_elementtree.so
rm -f main.dist/_heapq.so
rm -f main.dist/_lzma.so
rm -f main.dist/_multiprocessing.so
rm -f main.dist/_opcode.so
rm -f main.dist/_pickle.so
rm -f main.dist/_posixshmem.so
rm -f main.dist/_queue.so
rm -f main.dist/_sha512.so
rm -f main.dist/_statistics.so
rm -f main.dist/_uuid.so
rm -f main.dist/fcntl.so
rm -f main.dist/grp.so
rm -f main.dist/libbz2.so.*
rm -f main.dist/libcrypto.so.*
rm -f main.dist/libffi.so.*
rm -f main.dist/libgdbm.so.*
rm -f main.dist/libgdbm_compat.so.*
rm -f main.dist/liblzma.so.*
rm -f main.dist/libreadline.so.*
rm -f main.dist/libssl.so.*
rm -f main.dist/libtinfo.so.*
rm -f main.dist/libuuid.so.*
rm -f main.dist/mmap.so
rm -f main.dist/readline.so
cp README.md main.dist/README.md
mv main.dist xdcmd-ubuntu
XZ_OPT=-9e tar Jcf xdcmd-ubuntu.tar.xz xdcmd-ubuntu
- name: Upload result
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xdcmd-ubuntu
path: xdcmd-ubuntu.tar.xz
- name: Build executable (onefile)
run: |
python3 -m nuitka --standalone --onefile --assume-yes-for-downloads --output-filename=xdcmd main.py
mkdir xdcmd-ubuntu-onefile
mv xdcmd xdcmd-ubuntu-onefile/xdcmd
chmod +x xdcmd-ubuntu-onefile/xdcmd
cp README.md xdcmd-ubuntu-onefile/README.md
XZ_OPT=-9e tar Jcf xdcmd-ubuntu-onefile.tar.xz xdcmd-ubuntu-onefile
- name: Upload result (onefile)
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xdcmd-ubuntu-onefile
path: xdcmd-ubuntu-onefile.tar.xz
build-macos-arm64:
runs-on: macos-latest
env:
PYTHONIOENCODING: utf-8
PYTHONOPTIMIZE: 1
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: requirements.txt
- name: Cache nuitka dependencies
uses: actions/cache@v3
with:
path: ~/.cache/xdcmd
key: macos-arm64-nuitka
- name: Install pip dependencies
run: |
pip install -U -r requirements.txt
pip install -U nuitka zstandard ordered-set
brew install patchelf ccache
- name: Build executable
run: |
echo COMMIT_HASH = \"$(git rev-parse HEAD)\" > xdnmb/version.py
python3 -m nuitka --standalone --assume-yes-for-downloads main.py
mv main.dist/main.bin main.dist/xdcmd
chmod +x main.dist/xdcmd
cp README.md main.dist/README.md
mv main.dist xdcmd-macos-arm64
XZ_OPT=-9e tar Jcf xdcmd-macos-arm64.tar.xz xdcmd-macos-arm64
- name: Upload result
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xdcmd-macos-arm64
path: xdcmd-macos-arm64.tar.xz
- name: Build executable (onefile)
run: |
python3 -m nuitka --standalone --onefile --assume-yes-for-downloads --output-filename=xdcmd main.py
mkdir xdcmd-macos-arm64-onefile
mv xdcmd xdcmd-macos-arm64-onefile/xdcmd
chmod +x xdcmd-macos-arm64-onefile/xdcmd
cp README.md xdcmd-macos-arm64-onefile/README.md
XZ_OPT=-9e tar Jcf xdcmd-macos-arm64-onefile.tar.xz xdcmd-macos-arm64-onefile
- name: Upload result (onefile)
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xdcmd-macos-arm64-onefile
path: xdcmd-macos-arm64-onefile.tar.xz
build-macos-x86:
runs-on: macos-13
env:
PYTHONIOENCODING: utf-8
PYTHONOPTIMIZE: 1
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: requirements.txt
- name: Cache nuitka dependencies
uses: actions/cache@v3
with:
path: ~/.cache/xdcmd
key: macos-x86-nuitka
- name: Install pip dependencies
run: |
pip install -U -r requirements.txt
pip install -U nuitka zstandard ordered-set
brew install patchelf ccache
- name: Build executable
run: |
echo COMMIT_HASH = \"$(git rev-parse HEAD)\" > xdnmb/version.py
python3 -m nuitka --standalone --assume-yes-for-downloads main.py
mv main.dist/main.bin main.dist/xdcmd
chmod +x main.dist/xdcmd
cp README.md main.dist/README.md
mv main.dist xdcmd-macos-x86
XZ_OPT=-9e tar Jcf xdcmd-macos-x86.tar.xz xdcmd-macos-x86
- name: Upload result
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xdcmd-macos-x86
path: xdcmd-macos-x86.tar.xz
- name: Build executable (onefile)
run: |
python3 -m nuitka --standalone --onefile --assume-yes-for-downloads --output-filename=xdcmd main.py
mkdir xdcmd-macos-x86-onefile
mv xdcmd xdcmd-macos-x86-onefile/xdcmd
chmod +x xdcmd-macos-x86-onefile/xdcmd
cp README.md xdcmd-macos-x86-onefile/README.md
XZ_OPT=-9e tar Jcf xdcmd-macos-x86-onefile.tar.xz xdcmd-macos-x86-onefile
- name: Upload result (onefile)
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: xdcmd-macos-x86-onefile
path: xdcmd-macos-x86-onefile.tar.xz