diff options
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/build.yml | 187 |
1 files changed, 187 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..600e9c6 --- /dev/null +++ b/.github/workflows/build.yml | |||
| @@ -0,0 +1,187 @@ | |||
| 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 | sudo apt-get install libusb-1.0-0-dev | ||
| 16 | - name: prepare environment | ||
| 17 | run: | | ||
| 18 | echo "target_triplet=`gcc -dumpmachine`" >> $GITHUB_ENV | ||
| 19 | - name: fetch libplist | ||
| 20 | uses: dawidd6/action-download-artifact@v6 | ||
| 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 libimobiledevice-glue | ||
| 27 | uses: dawidd6/action-download-artifact@v6 | ||
| 28 | with: | ||
| 29 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
| 30 | workflow: build.yml | ||
| 31 | name: libimobiledevice-glue-latest_${{env.target_triplet}} | ||
| 32 | repo: libimobiledevice/libimobiledevice-glue | ||
| 33 | - name: install external dependencies | ||
| 34 | run: | | ||
| 35 | mkdir extract | ||
| 36 | for I in *.tar; do | ||
| 37 | tar -C extract -xvf $I | ||
| 38 | done | ||
| 39 | sudo cp -r extract/* / | ||
| 40 | sudo ldconfig | ||
| 41 | - uses: actions/checkout@v4 | ||
| 42 | - name: autogen | ||
| 43 | run: ./autogen.sh PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LDFLAGS="-Wl,-rpath=/usr/local/lib" | ||
| 44 | - name: make | ||
| 45 | run: make | ||
| 46 | - name: make install | ||
| 47 | run: sudo make install | ||
| 48 | - name: prepare artifact | ||
| 49 | run: | | ||
| 50 | mkdir -p dest | ||
| 51 | DESTDIR=`pwd`/dest make install | ||
| 52 | tar -C dest -cf libirecovery.tar --strip-components 1 . | ||
| 53 | - name: publish artifact | ||
| 54 | uses: actions/upload-artifact@v4 | ||
| 55 | with: | ||
| 56 | name: libirecovery-latest_${{env.target_triplet}} | ||
| 57 | path: libirecovery.tar | ||
| 58 | build-macOS: | ||
| 59 | runs-on: macOS-latest | ||
| 60 | steps: | ||
| 61 | - name: install dependencies | ||
| 62 | run: | | ||
| 63 | if test -x "`which port`"; then | ||
| 64 | sudo port install libtool autoconf automake pkgconfig | ||
| 65 | else | ||
| 66 | brew install libtool autoconf automake pkgconfig | ||
| 67 | fi | ||
| 68 | shell: bash | ||
| 69 | - name: fetch libplist | ||
| 70 | uses: dawidd6/action-download-artifact@v6 | ||
| 71 | with: | ||
| 72 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
| 73 | workflow: build.yml | ||
| 74 | name: libplist-latest_macOS | ||
| 75 | repo: libimobiledevice/libplist | ||
| 76 | - name: fetch libimobiledevice-glue | ||
| 77 | uses: dawidd6/action-download-artifact@v6 | ||
| 78 | with: | ||
| 79 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
| 80 | workflow: build.yml | ||
| 81 | name: libimobiledevice-glue-latest_macOS | ||
| 82 | repo: libimobiledevice/libimobiledevice-glue | ||
| 83 | - name: install external dependencies | ||
| 84 | run: | | ||
| 85 | mkdir extract | ||
| 86 | for I in *.tar; do | ||
| 87 | tar -C extract -xvf $I | ||
| 88 | done | ||
| 89 | sudo cp -r extract/* / | ||
| 90 | - uses: actions/checkout@v4 | ||
| 91 | - name: autogen | ||
| 92 | run: | | ||
| 93 | SDKDIR=`xcrun --sdk macosx --show-sdk-path` | ||
| 94 | TESTARCHS="arm64 x86_64" | ||
| 95 | USEARCHS= | ||
| 96 | for ARCH in $TESTARCHS; do | ||
| 97 | if echo "int main(int argc, char **argv) { return 0; }" |clang -arch $ARCH -o /dev/null -isysroot $SDKDIR -x c - 2>/dev/null; then | ||
| 98 | USEARCHS="$USEARCHS -arch $ARCH" | ||
| 99 | fi | ||
| 100 | done | ||
| 101 | export CFLAGS="$USEARCHS -isysroot $SDKDIR" | ||
| 102 | echo "Using CFLAGS: $CFLAGS" | ||
| 103 | ./autogen.sh PKG_CONFIG_PATH=/usr/local/lib/pkgconfig | ||
| 104 | - name: make | ||
| 105 | run: make | ||
| 106 | - name: make install | ||
| 107 | run: sudo make install | ||
| 108 | - name: prepare artifact | ||
| 109 | run: | | ||
| 110 | mkdir -p dest | ||
| 111 | DESTDIR=`pwd`/dest make install | ||
| 112 | tar -C dest -cf libirecovery.tar --strip-components 1 . | ||
| 113 | - name: publish artifact | ||
| 114 | uses: actions/upload-artifact@v4 | ||
| 115 | with: | ||
| 116 | name: libirecovery-latest_macOS | ||
| 117 | path: libirecovery.tar | ||
| 118 | build-windows: | ||
| 119 | runs-on: windows-latest | ||
| 120 | defaults: | ||
| 121 | run: | ||
| 122 | shell: msys2 {0} | ||
| 123 | strategy: | ||
| 124 | fail-fast: false | ||
| 125 | matrix: | ||
| 126 | include: [ | ||
| 127 | { msystem: MINGW64, arch: x86_64 }, | ||
| 128 | { msystem: MINGW32, arch: i686 } | ||
| 129 | ] | ||
| 130 | steps: | ||
| 131 | - uses: msys2/setup-msys2@v2 | ||
| 132 | with: | ||
| 133 | msystem: ${{ matrix.msystem }} | ||
| 134 | release: false | ||
| 135 | update: false | ||
| 136 | install: >- | ||
| 137 | base-devel | ||
| 138 | git | ||
| 139 | mingw-w64-${{ matrix.arch }}-gcc | ||
| 140 | mingw-w64-${{ matrix.arch }}-pkg-config | ||
| 141 | make | ||
| 142 | libtool | ||
| 143 | autoconf | ||
| 144 | automake-wrapper | ||
| 145 | - name: prepare environment | ||
| 146 | run: | | ||
| 147 | dest=`echo ${{ matrix.msystem }} |tr [:upper:] [:lower:]` | ||
| 148 | echo "dest=$dest" >> $GITHUB_ENV | ||
| 149 | echo "target_triplet=`gcc -dumpmachine`" >> $GITHUB_ENV | ||
| 150 | - name: fetch libplist | ||
| 151 | uses: dawidd6/action-download-artifact@v6 | ||
| 152 | with: | ||
| 153 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
| 154 | workflow: build.yml | ||
| 155 | name: libplist-latest_${{ matrix.arch }}-${{ env.dest }} | ||
| 156 | repo: libimobiledevice/libplist | ||
| 157 | - name: fetch libimobiledevice-glue | ||
| 158 | uses: dawidd6/action-download-artifact@v6 | ||
| 159 | with: | ||
| 160 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
| 161 | workflow: build.yml | ||
| 162 | name: libimobiledevice-glue-latest_${{ matrix.arch }}-${{ env.dest }} | ||
| 163 | repo: libimobiledevice/libimobiledevice-glue | ||
| 164 | - name: install external dependencies | ||
| 165 | run: | | ||
| 166 | mkdir extract | ||
| 167 | for I in *.tar; do | ||
| 168 | tar -C extract -xvf $I | ||
| 169 | done | ||
| 170 | cp -r extract/* / | ||
| 171 | - uses: actions/checkout@v4 | ||
| 172 | - name: autogen | ||
| 173 | run: ./autogen.sh CC=gcc CXX=g++ | ||
| 174 | - name: make | ||
| 175 | run: make | ||
| 176 | - name: make install | ||
| 177 | run: make install | ||
| 178 | - name: prepare artifact | ||
| 179 | run: | | ||
| 180 | mkdir -p dest | ||
| 181 | DESTDIR=`pwd`/dest make install | ||
| 182 | tar -C dest -cf libirecovery.tar ${{ env.dest }} | ||
| 183 | - name: publish artifact | ||
| 184 | uses: actions/upload-artifact@v4 | ||
| 185 | with: | ||
| 186 | name: libirecovery-latest_${{ matrix.arch }}-${{ env.dest }} | ||
| 187 | path: libirecovery.tar | ||
