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