build.yml 5.7 KB

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