diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/build.yml | 260 |
1 files changed, 260 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0298939 --- /dev/null +++ b/.github/workflows/build.yml | |||
@@ -0,0 +1,260 @@ | |||
1 | name: build | ||
2 | |||
3 | on: | ||
4 | push: | ||
5 | schedule: | ||
6 | - cron: '0 0 1 * *' | ||
7 | |||
8 | jobs: | ||
9 | build-linux-ubuntu: | ||
10 | runs-on: ubuntu-latest | ||
11 | steps: | ||
12 | - name: install dependencies | ||
13 | run: | | ||
14 | sudo apt-get update | ||
15 | pip install cython | ||
16 | - name: prepare environment | ||
17 | run: | | ||
18 | echo "target_triplet=`gcc -dumpmachine`" >> $GITHUB_ENV | ||
19 | - name: fetch libplist | ||
20 | uses: dawidd6/action-download-artifact@v3 | ||
21 | with: | ||
22 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
23 | workflow: build.yml | ||
24 | name: libplist-latest_${{env.target_triplet}} | ||
25 | repo: libimobiledevice/libplist | ||
26 | - name: fetch libusbmuxd | ||
27 | uses: dawidd6/action-download-artifact@v3 | ||
28 | with: | ||
29 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
30 | workflow: build.yml | ||
31 | name: libusbmuxd-latest_${{env.target_triplet}} | ||
32 | repo: libimobiledevice/libusbmuxd | ||
33 | - name: fetch libimobiledevice-glue | ||
34 | uses: dawidd6/action-download-artifact@v3 | ||
35 | with: | ||
36 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
37 | workflow: build.yml | ||
38 | name: libimobiledevice-glue-latest_${{env.target_triplet}} | ||
39 | repo: libimobiledevice/libimobiledevice-glue | ||
40 | - name: fetch libtatsu | ||
41 | uses: dawidd6/action-download-artifact@v3 | ||
42 | with: | ||
43 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
44 | workflow: build.yml | ||
45 | name: libtatsu-latest_${{env.target_triplet}} | ||
46 | repo: libimobiledevice/libtatsu | ||
47 | - name: install external dependencies | ||
48 | run: | | ||
49 | mkdir extract | ||
50 | for I in *.tar; do | ||
51 | tar -C extract -xvf $I | ||
52 | done | ||
53 | sudo cp -r extract/* / | ||
54 | sudo ldconfig | ||
55 | - uses: actions/checkout@v4 | ||
56 | with: | ||
57 | fetch-depth: 0 | ||
58 | - name: autogen | ||
59 | run: ./autogen.sh PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LDFLAGS="-Wl,-rpath=/usr/local/lib" --enable-debug | ||
60 | - name: make | ||
61 | run: make | ||
62 | - name: make install | ||
63 | run: sudo make install | ||
64 | - name: prepare artifact | ||
65 | run: | | ||
66 | mkdir -p dest | ||
67 | DESTDIR=`pwd`/dest make install | ||
68 | tar -C dest -cf libimobiledevice.tar usr | ||
69 | - name: publish artifact | ||
70 | uses: actions/upload-artifact@v4 | ||
71 | with: | ||
72 | name: libimobiledevice-latest_${{env.target_triplet}} | ||
73 | path: libimobiledevice.tar | ||
74 | build-macOS: | ||
75 | runs-on: macOS-latest | ||
76 | steps: | ||
77 | - name: install dependencies | ||
78 | run: | | ||
79 | if test -x "`which port`"; then | ||
80 | sudo port install libtool autoconf automake pkgconfig | ||
81 | else | ||
82 | brew install libtool autoconf automake pkgconfig | ||
83 | fi | ||
84 | pip3 install --break-system-packages cython | ||
85 | shell: bash | ||
86 | - name: fetch libplist | ||
87 | uses: dawidd6/action-download-artifact@v3 | ||
88 | with: | ||
89 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
90 | workflow: build.yml | ||
91 | name: libplist-latest_macOS | ||
92 | repo: libimobiledevice/libplist | ||
93 | - name: fetch libusbmuxd | ||
94 | uses: dawidd6/action-download-artifact@v3 | ||
95 | with: | ||
96 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
97 | workflow: build.yml | ||
98 | name: libusbmuxd-latest_macOS | ||
99 | repo: libimobiledevice/libusbmuxd | ||
100 | - name: fetch libimobiledevice-glue | ||
101 | uses: dawidd6/action-download-artifact@v3 | ||
102 | with: | ||
103 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
104 | workflow: build.yml | ||
105 | name: libimobiledevice-glue-latest_macOS | ||
106 | repo: libimobiledevice/libimobiledevice-glue | ||
107 | - name: fetch libtatsu | ||
108 | uses: dawidd6/action-download-artifact@v3 | ||
109 | with: | ||
110 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
111 | workflow: build.yml | ||
112 | name: libtatsu-latest_macOS | ||
113 | repo: libimobiledevice/libtatsu | ||
114 | - name: install external dependencies | ||
115 | run: | | ||
116 | mkdir extract | ||
117 | for I in *.tar; do | ||
118 | tar -C extract -xvf $I | ||
119 | done | ||
120 | sudo cp -r extract/* / | ||
121 | - uses: actions/checkout@v4 | ||
122 | - name: install additional requirements | ||
123 | run: | | ||
124 | mkdir -p lib | ||
125 | curl -o lib/libcrypto.35.tbd -Ls \ | ||
126 | https://gist.github.com/nikias/94c99fd145a75a5104415e5117b0cafa/raw/5209dfbff5a871a14272afe4794e76eb4cf6f062/libcrypto.35.tbd | ||
127 | curl -o lib/libssl.35.tbd -Ls \ | ||
128 | https://gist.github.com/nikias/94c99fd145a75a5104415e5117b0cafa/raw/5209dfbff5a871a14272afe4794e76eb4cf6f062/libssl.35.tbd | ||
129 | echo "LIBSSL=`pwd`/lib/libssl.35.tbd" >> $GITHUB_ENV | ||
130 | echo "LIBCRYPTO=`pwd`/lib/libcrypto.35.tbd" >> $GITHUB_ENV | ||
131 | LIBRESSL_VER=2.2.7 | ||
132 | echo "LIBRESSL_VER=$LIBRESSL_VER" >> $GITHUB_ENV | ||
133 | FILENAME="libressl-$LIBRESSL_VER.tar.gz" | ||
134 | curl -o $FILENAME -Ls "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/$FILENAME" | ||
135 | mkdir -p deps | ||
136 | tar -C deps -xzf $FILENAME | ||
137 | echo "DEPSDIR=`pwd`/deps" >> $GITHUB_ENV | ||
138 | - name: autogen | ||
139 | run: | | ||
140 | SDKDIR=`xcrun --sdk macosx --show-sdk-path` | ||
141 | TESTARCHS="arm64 x86_64" | ||
142 | USEARCHS= | ||
143 | for ARCH in $TESTARCHS; do | ||
144 | if echo "int main(int argc, char **argv) { return 0; }" |clang -arch $ARCH -o /dev/null -isysroot $SDKDIR -x c - 2>/dev/null; then | ||
145 | USEARCHS="$USEARCHS -arch $ARCH" | ||
146 | fi | ||
147 | done | ||
148 | export CFLAGS="$USEARCHS -isysroot $SDKDIR" | ||
149 | echo "Using CFLAGS: $CFLAGS" | ||
150 | PYTHON3_BIN=`xcrun -f python3` | ||
151 | if test -x $PYTHON3_BIN; then | ||
152 | export PYTHON=$PYTHON3_BIN | ||
153 | PYTHON_VER=`$PYTHON3_BIN -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'))"` | ||
154 | PYTHON_EXEC_PREFIX=`$PYTHON3_BIN -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('exec_prefix'))"` | ||
155 | PYTHON_LIBS_PATH=$PYTHON_EXEC_PREFIX/lib | ||
156 | PYTHON_FRAMEWORK_PATH=$PYTHON_EXEC_PREFIX/Python3 | ||
157 | export PYTHON_LIBS="-L$PYTHON_LIBS_PATH -lpython$PYTHON_VER" | ||
158 | export PYTHON_EXTRA_LDFLAGS="-Wl,-stack_size,1000000 -framework CoreFoundation $PYTHON_FRAMEWORK_PATH" | ||
159 | fi | ||
160 | ./autogen.sh PKG_CONFIG_PATH=/usr/local/lib/pkgconfig --enable-debug \ | ||
161 | openssl_CFLAGS="-I${{ env.DEPSDIR }}/libressl-${{ env.LIBRESSL_VER }}/include" \ | ||
162 | openssl_LIBS="-Xlinker ${{ env.LIBSSL }} -Xlinker ${{ env.LIBCRYPTO }}" | ||
163 | - name: make | ||
164 | run: make | ||
165 | - name: make install | ||
166 | run: sudo make install | ||
167 | - name: prepare artifact | ||
168 | run: | | ||
169 | mkdir -p dest | ||
170 | DESTDIR=`pwd`/dest make install | ||
171 | tar -C dest -cf libimobiledevice.tar usr | ||
172 | - name: publish artifact | ||
173 | uses: actions/upload-artifact@v4 | ||
174 | with: | ||
175 | name: libimobiledevice-latest_macOS | ||
176 | path: libimobiledevice.tar | ||
177 | build-windows: | ||
178 | runs-on: windows-2019 | ||
179 | defaults: | ||
180 | run: | ||
181 | shell: msys2 {0} | ||
182 | strategy: | ||
183 | fail-fast: false | ||
184 | matrix: | ||
185 | include: [ | ||
186 | { msystem: MINGW64, arch: x86_64 }, | ||
187 | { msystem: MINGW32, arch: i686 } | ||
188 | ] | ||
189 | steps: | ||
190 | - uses: msys2/setup-msys2@v2 | ||
191 | with: | ||
192 | msystem: ${{ matrix.msystem }} | ||
193 | release: false | ||
194 | update: false | ||
195 | install: >- | ||
196 | base-devel | ||
197 | git | ||
198 | mingw-w64-${{ matrix.arch }}-gcc | ||
199 | make | ||
200 | libtool | ||
201 | autoconf | ||
202 | automake-wrapper | ||
203 | - name: prepare environment | ||
204 | run: | | ||
205 | dest=`echo ${{ matrix.msystem }} |tr [:upper:] [:lower:]` | ||
206 | echo "dest=$dest" >> $GITHUB_ENV | ||
207 | echo "target_triplet=`gcc -dumpmachine`" >> $GITHUB_ENV | ||
208 | git config --global core.autocrlf false | ||
209 | - name: fetch libplist | ||
210 | uses: dawidd6/action-download-artifact@v3 | ||
211 | with: | ||
212 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
213 | workflow: build.yml | ||
214 | name: libplist-latest_${{ matrix.arch }}-${{ env.dest }} | ||
215 | repo: libimobiledevice/libplist | ||
216 | - name: fetch libusbmuxd | ||
217 | uses: dawidd6/action-download-artifact@v3 | ||
218 | with: | ||
219 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
220 | workflow: build.yml | ||
221 | name: libusbmuxd-latest_${{ matrix.arch }}-${{ env.dest }} | ||
222 | repo: libimobiledevice/libusbmuxd | ||
223 | - name: fetch libimobiledevice-glue | ||
224 | uses: dawidd6/action-download-artifact@v3 | ||
225 | with: | ||
226 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
227 | workflow: build.yml | ||
228 | name: libimobiledevice-glue-latest_${{ matrix.arch }}-${{ env.dest }} | ||
229 | repo: libimobiledevice/libimobiledevice-glue | ||
230 | - name: fetch libtatsu | ||
231 | uses: dawidd6/action-download-artifact@v3 | ||
232 | with: | ||
233 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
234 | workflow: build.yml | ||
235 | name: libtatsu-latest_${{ matrix.arch }}-${{ env.dest }} | ||
236 | repo: libimobiledevice/libtatsu | ||
237 | - name: install external dependencies | ||
238 | run: | | ||
239 | mkdir extract | ||
240 | for I in *.tar; do | ||
241 | tar -C extract -xvf $I | ||
242 | done | ||
243 | cp -r extract/* / | ||
244 | - uses: actions/checkout@v4 | ||
245 | - name: autogen | ||
246 | run: ./autogen.sh CC=gcc CXX=g++ --enable-debug | ||
247 | - name: make | ||
248 | run: make | ||
249 | - name: make install | ||
250 | run: make install | ||
251 | - name: prepare artifact | ||
252 | run: | | ||
253 | mkdir -p dest | ||
254 | DESTDIR=`pwd`/dest make install | ||
255 | tar -C dest -cf libimobiledevice.tar ${{ env.dest }} | ||
256 | - name: publish artifact | ||
257 | uses: actions/upload-artifact@v4 | ||
258 | with: | ||
259 | name: libimobiledevice-latest_${{ matrix.arch }}-${{ env.dest }} | ||
260 | path: libimobiledevice.tar | ||