build.yml 4.8 KB

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