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