-
Notifications
You must be signed in to change notification settings - Fork 25
247 lines (242 loc) · 8.79 KB
/
build.yml
File metadata and controls
247 lines (242 loc) · 8.79 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
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
name: Build release binary
on:
release:
types: [published]
#push:
# tags:
# - v*.*.*
jobs:
build-win64:
name: Build x64 Windows binary
runs-on: windows-2019
env:
BUILD_ARCH: x64
BUILD_LOGLEVEL: verbose
steps:
- uses: ilammy/setup-nasm@v1
- uses: MatteoH2O1999/setup-python@v1
id: py
with:
python-version: '2.7'
- uses: actions/checkout@v3
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- run: npm install --production --ignore-scripts
- run: npm install --production
working-directory: nexe
# workaround issue https://github.com/nodejs/node/issues/52681#issuecomment-2076426887
- run: |
(Get-Content -Path "node_modules/nexe/lib/compiler.js" -Raw) -replace 'cwd: this.src,', 'shell: true, cwd: this.src,' | Set-Content -Path "node_modules/nexe/lib/compiler.js"
working-directory: nexe
- run: node build
working-directory: nexe
- run: nexe\parpar.exe --version
- run: nexe\parpar.exe -r1 -s1M -o nexe\test.par2 nexe\parpar.exe
- run: move nexe\parpar.exe parpar.exe && 7z a -t7z -mx=9 parpar.7z parpar.exe
- uses: sekwah41/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./parpar.7z
asset_name: parpar-${{ steps.get_release.outputs.tag_name }}-win64.7z
asset_content_type: application/octet-stream
build-linux-amd64:
strategy:
fail-fast: false
matrix:
static:
- name: glibc2.31
flag: --partly-static
- name: static
flag: --fully-static
name: Build amd64 Linux ${{ matrix.static.name }} binary
runs-on: ubuntu-20.04
env:
BUILD_ARCH: x64
BUILD_LOGLEVEL: verbose
BUILD_STATIC: ${{ matrix.static.flag }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
id: py
with:
python-version: '3.9' # workaround "cannot import name 'Mapping' from 'collections'" error
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- run: |
sudo apt-get update
sudo apt-get install -y gcc-10 g++-10
- run: npm install --production --ignore-scripts
- run: npm install --production
working-directory: nexe
# diagnose weird failure between initial message and download message
- run: sed -i '/return tryInvokeMiddleware/i try{console.log("Invoke middleware", mw.name);}catch(x){}' node_modules/app-builder/lib/compose.js
working-directory: nexe
continue-on-error: true
- run: node build
working-directory: nexe
env:
CC: gcc-10
CXX: g++-10
- run: nexe/parpar --version
- run: nexe/parpar -r1 -s1M -onexe/test.par2 nexe/parpar
- run: xz -9e --x86 --lzma2 nexe/parpar -c > parpar.xz
- uses: sekwah41/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./parpar.xz
asset_name: parpar-${{ steps.get_release.outputs.tag_name }}-linux-${{ matrix.static.name }}-amd64.xz
asset_content_type: application/octet-stream
build-linux-aarch64:
strategy:
fail-fast: false
matrix:
static:
- name: glibc2.35
flag: --partly-static
- name: static
flag: --fully-static
name: Build aarch64 Linux ${{ matrix.static.name }} binary
runs-on: ubuntu-22.04
env:
BUILD_ARCH: arm64
BUILD_LOGLEVEL: verbose
BUILD_STATIC: ${{ matrix.static.flag }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
id: py
with:
python-version: '3.9' # workaround "cannot import name 'Mapping' from 'collections'" error
- uses: junelife/gha-ubuntu-cross@v6
with:
arch: arm64
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- run: npm install --production --ignore-scripts
- run: npm install --production
working-directory: nexe
# diagnose weird failure between initial message and download message
- run: sed -i '/return tryInvokeMiddleware/i try{console.log("Invoke middleware", mw.name);}catch(x){}' node_modules/app-builder/lib/compose.js
working-directory: nexe
continue-on-error: true
- run: node build
working-directory: nexe
env:
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++
CC_host: cc
CXX_host: c++
- run: xz -9e --lzma2 nexe/parpar -c > parpar.xz
- uses: sekwah41/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./parpar.xz
asset_name: parpar-${{ steps.get_release.outputs.tag_name }}-linux-${{ matrix.static.name }}-aarch64.xz
asset_content_type: application/octet-stream
# build-linux-armv7l:
# strategy:
# fail-fast: false
# matrix:
# static:
# - name: glibc2.31
# flag: --partly-static
# - name: static
# flag: --fully-static
# name: Build armv7l Linux ${{ matrix.static.name }} binary
# runs-on: ubuntu-20.04
# env:
# BUILD_ARCH: armhf
# BUILD_LOGLEVEL: verbose
# BUILD_CONFIGURE: '--with-arm-float-abi=hard --with-arm-fpu=vfpv3-d16'
# BUILD_STATIC: ${{ matrix.static.flag }}
# BUILD_NO_LTO: 1 # AArch32 compilers don't like mixing FPU modes with LTO [https://github.com/sabnzbd/#sabctools/issues/56#issuecomment-1151994494]
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# id: py
# with:
# python-version: '3.9' # workaround "cannot import name 'Mapping' from 'collections'" error
# - uses: junelife/gha-ubuntu-cross@v6
# with:
# arch: armhf
# - uses: ryankurte/action-apt@v0.3.0
# with:
# arch: i386 # '-m32' switch doesn't work without this
# packages: "libstdc++-$(c++ -dumpversion)-dev:i386 libc6-dev:i386"
# - name: Get release
# id: get_release
# uses: bruceadams/get-release@v1.3.2
# env:
# GITHUB_TOKEN: ${{ github.token }}
# - run: npm install --production --ignore-scripts
# - run: npm install --production
# working-directory: nexe
# - run: node build
# working-directory: nexe
# env:
# CC: arm-linux-gnueabihf-gcc
# CXX: arm-linux-gnueabihf-g++
# CC_host: cc
# CXX_host: c++
# - run: xz -9e --arm --lzma2 nexe/parpar -c > parpar.xz
# - uses: sekwah41/upload-release-assets@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ steps.get_release.outputs.upload_url }}
# asset_path: ./parpar.xz
# asset_name: parpar-${{ steps.get_release.outputs.tag_name }}-linux-${{ matrix.static.name }}-armv7l.xz
# asset_content_type: application/octet-stream
build-mac:
strategy:
fail-fast: false
matrix:
m:
- { os: macos-13, arch: x64, xz_flag: '--x86' }
#- { os: macos-14, arch: arm64, xz_flag: '' } # requires Node 16 I think
name: Build ${{ matrix.m.arch }} MacOS binary
runs-on: ${{ matrix.m.os }}
env:
BUILD_ARCH: ${{ matrix.m.arch }}
BUILD_LOGLEVEL: verbose
steps:
- uses: actions/checkout@v3
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- run: npm install --production --ignore-scripts
- run: npm install --production
working-directory: nexe
- uses: actions/setup-python@v5
with:
python-version: '3.9' # 'pipes' removed in Python 3.13, 'rU' mode unsupported in 3.11
- run: node build
working-directory: nexe
- run: nexe/parpar --version
- run: nexe/parpar -r1 -s1M -onexe/test.par2 nexe/parpar
- run: xz -9e ${{ matrix.m.xz_flag }} --lzma2 nexe/parpar -c > parpar.xz
- uses: sekwah41/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./parpar.xz
asset_name: parpar-${{ steps.get_release.outputs.tag_name }}-macos-${{ matrix.m.arch }}.xz
asset_content_type: application/octet-stream