forked from Parchive/par2cmdline
-
Notifications
You must be signed in to change notification settings - Fork 7
211 lines (206 loc) · 6.97 KB
/
build-dev.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
name: Build dev binary
on:
workflow_dispatch:
jobs:
build-dev-win:
strategy:
fail-fast: false
matrix:
include:
- platform: x64
bcj: -mf=BCJ2
name: x64
- platform: Win32
bcj: -mf=BCJ2
name: x86
- platform: ARM64
bcj: # -mf=ARM64
name: arm64
name: Build ${{ matrix.name }} Windows binary
runs-on: windows-2019
steps:
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/checkout@v3
- run: msbuild -property:PlatformToolset=ClangCL -property:Configuration=Release -property:Platform=${{ matrix.platform }} par2cmdline.sln
- run: move "${{ matrix.platform }}\Release\par2.exe" par2.exe && 7z a -t7z -mx=9 ${{ matrix.bcj }} par2.7z par2.exe
- uses: actions/upload-artifact@v3
with:
path: ./par2.7z
name: par2cmdline-turbo-dev-win-${{ matrix.name }}.7z
retention-days: 5
# build-dev-linux-static:
# strategy:
# fail-fast: false
# matrix:
# include:
# - target: x86_64-linux-musl
# xz_bcj: --x86
# name: amd64
# configure_host:
# - target: aarch64-linux-musl
# xz_bcj: # --arm64 # requires xz utils >=5.4 to decompress
# name: aarch64
# configure_host: --host=aarch64
# - target: armv7l-linux-musleabihf
# xz_bcj: --arm
# name: armv7l
# configure_host: --host=armv7l
# name: Build ${{ matrix.name }} Linux static binary
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: Lesmiscore/musl-cross-compilers@heracles
# id: musl
# with:
# target: ${{ matrix.target }}
# - run: aclocal && automake --warnings=all --add-missing && autoconf --warnings=all
# - run: ./configure ${{ matrix.configure_host }}
# env:
# CC: ${{ steps.musl.outputs.path }}/${{ matrix.target }}-cc
# CXX: ${{ steps.musl.outputs.path }}/${{ matrix.target }}-c++
# LDFLAGS: -static -s
# - uses: actions/upload-artifact@v3
# with:
# path: ./config.log
# name: configure-linux-${{ matrix.arch }}.log
# retention-days: 5
# if: ${{ failure() }}
# - run: make
# - run: ./par2 -h
# if: ${{ matrix.name == 'amd64' }}
# - run: make check
# if: ${{ matrix.name == 'amd64' }}
# - run: xz -9e ${{ matrix.xz_bcj }} --lzma2 par2 -c > par2.xz
# - uses: actions/upload-artifact@v3
# with:
# path: ./par2.xz
# name: par2cmdline-turbo-dev-linux-${{ matrix.name }}.xz
# retention-days: 5
build-dev-linux-static:
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
xz_bcj: --x86
xcc:
configure_host:
- arch: arm64
xz_bcj: # --arm64 # requires xz utils >=5.4 to decompress
xcc: aarch64-linux-gnu-
configure_host: --host=aarch64-linux-gnu
- arch: armhf
xz_bcj: --arm
xcc: arm-linux-gnueabihf-
configure_host: --host=armv7l-linux-gnueabihf
- arch: riscv64
xz_bcj:
xcc: riscv64-linux-gnu-
configure_host: --host=riscv64-linux-gnu
- arch: powerpc
xz_bcj:
xcc: powerpc-linux-gnu-
configure_host: --host=powerpc-linux-gnu
name: Build ${{ matrix.arch }} Linux static binary
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: junelife/gha-ubuntu-cross@v6
with:
arch: ${{ matrix.arch }}
if: ${{ matrix.arch != 'amd64' }}
- run: aclocal && automake --warnings=all --add-missing && autoconf --warnings=all
- run: ./configure ${{ matrix.configure_host }}
env:
CC: ${{ matrix.xcc }}gcc
CXX: ${{ matrix.xcc }}g++
LDFLAGS: -static -s
- uses: actions/upload-artifact@v3
with:
path: ./config.log
name: configure-linux-${{ matrix.arch }}.log
retention-days: 5
if: ${{ failure() }}
- run: make
- run: ./par2 -h
if: ${{ matrix.arch == 'amd64' }}
- run: make check
if: ${{ matrix.arch == 'amd64' }}
- run: xz -9e ${{ matrix.xz_bcj }} --lzma2 par2 -c > par2.xz
- uses: actions/upload-artifact@v3
with:
path: ./par2.xz
name: par2cmdline-turbo-dev-linux-${{ matrix.arch }}.xz
retention-days: 5
build-dev-mac-x64:
name: Build x64 MacOS binary
runs-on: macos-latest
steps:
- uses: ConorMacBride/install-package@v1
with:
brew: automake llvm
# force past "The `brew link` step did not complete successfully"
continue-on-error: true
- run: |
if [ -f "`brew --prefix llvm`/bin/clang" ]; then
echo "CC=`brew --prefix llvm`/bin/clang" >> $GITHUB_ENV
echo "CXX=`brew --prefix llvm`/bin/clang++" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
- run: aclocal && automake --warnings=all --add-missing && autoconf --warnings=all
- run: ./configure
- uses: actions/upload-artifact@v3
with:
path: ./config.log
name: configure-macos-x64.log
retention-days: 5
if: ${{ failure() }}
- run: make
- run: strip par2
- run: ./par2 -h
- run: make check
- run: xz -9e --x86 --lzma2 par2
- uses: actions/upload-artifact@v3
with:
path: ./par2.xz
name: par2cmdline-turbo-dev-macos-x64.xz
retention-days: 5
build-dev-mac-arm64:
name: Build arm64 MacOS binary
# avoid OpenSSL 3.0.2 on 22.04: https://github.com/tpoechtrager/osxcross/issues/349
runs-on: ubuntu-20.04
steps:
- uses: mbround18/setup-osxcross@main # OSXCROSS_TARGET unavailable in v1.1
with:
osx-version: "12.3"
- uses: actions/checkout@v3
- run: aclocal && automake --warnings=all --add-missing && autoconf --warnings=all
- run: ./configure --host=aarch64-macos
env:
CC: oa64-clang
CXX: oa64-clang++
AR: arm64-apple-darwin21.4-ar
RANLIB: arm64-apple-darwin21.4-ranlib
STRIP: arm64-apple-darwin21.4-strip
- uses: actions/upload-artifact@v3
with:
path: ./config.log
name: configure-macos-arm64.log
retention-days: 5
if: ${{ failure() }}
- run: make
- run: arm64-apple-darwin21.4-strip par2
- run: |
wget -q -O- https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.22.0/apple-codesign-0.22.0-x86_64-unknown-linux-musl.tar.gz | tar zxf -
apple-codesign*/rcodesign sign par2
- if: ${{ failure() }}
run: |
ls
ls apple-codesign*
find . -name rcodesign
- run: xz -9e --lzma2 par2
- uses: actions/upload-artifact@v3
with:
path: ./par2.xz
name: par2cmdline-turbo-dev-macos-arm64.xz
retention-days: 5