release.yml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. name: 'release'
  2. run-name: 'Create PhysicsFS release artifacts for ${{ inputs.commit }}'
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. commit:
  7. description: 'Commit of PhysicsFS'
  8. required: true
  9. jobs:
  10. src:
  11. runs-on: ubuntu-latest
  12. outputs:
  13. project: ${{ steps.releaser.outputs.project }}
  14. version: ${{ steps.releaser.outputs.version }}
  15. src-tar-gz: ${{ steps.releaser.outputs.src-tar-gz }}
  16. src-tar-xz: ${{ steps.releaser.outputs.src-tar-xz }}
  17. src-zip: ${{ steps.releaser.outputs.src-zip }}
  18. steps:
  19. - name: 'Set up Python'
  20. uses: actions/setup-python@v5
  21. with:
  22. python-version: '3.11'
  23. - name: 'Fetch build-release.py'
  24. uses: actions/checkout@v4
  25. with:
  26. sparse-checkout: 'build-scripts/build-release.py'
  27. - name: 'Set up SDL sources'
  28. uses: actions/checkout@v4
  29. with:
  30. path: 'physfs'
  31. fetch-depth: 0
  32. - name: 'Build Source archive'
  33. id: releaser
  34. shell: bash
  35. run: |
  36. python build-scripts/build-release.py \
  37. --actions source \
  38. --commit ${{ inputs.commit }} \
  39. --root "${{ github.workspace }}/physfs" \
  40. --github \
  41. --debug
  42. - name: 'Store source archives'
  43. uses: actions/upload-artifact@v4
  44. with:
  45. name: sources
  46. path: '${{ github.workspace}}/dist'
  47. - name: 'Generate summary'
  48. run: |
  49. echo "Run the following commands to download all artifacts:" >> $GITHUB_STEP_SUMMARY
  50. echo '```' >> $GITHUB_STEP_SUMMARY
  51. echo "mkdir -p /tmp/${{ steps.releaser.outputs.project }}-${{ steps.releaser.outputs.version }}" >> $GITHUB_STEP_SUMMARY
  52. echo "cd /tmp/${{ steps.releaser.outputs.project }}-${{ steps.releaser.outputs.version }}" >> $GITHUB_STEP_SUMMARY
  53. echo "gh run -R ${{ github.repository }} download ${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY
  54. echo '```' >> $GITHUB_STEP_SUMMARY
  55. linux-verify:
  56. needs: [src]
  57. runs-on: ubuntu-latest
  58. steps:
  59. - name: 'Download source archives'
  60. uses: actions/download-artifact@v4
  61. with:
  62. name: sources
  63. path: '${{ github.workspace }}'
  64. - name: 'Unzip ${{ needs.src.outputs.src-zip }}'
  65. id: zip
  66. run: |
  67. mkdir /tmp/zipdir
  68. cd /tmp/zipdir
  69. unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
  70. echo "path=/tmp/zipdir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
  71. - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
  72. id: tar
  73. run: |
  74. mkdir -p /tmp/tardir
  75. tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
  76. echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
  77. - name: 'Compare contents of ${{ needs.src.outputs.src-zip }} and ${{ needs.src.outputs.src-tar-gz }}'
  78. run: |
  79. diff /tmp/zipdir /tmp/tardir
  80. - name: 'Test versioning'
  81. shell: bash
  82. run: |
  83. ${{ steps.tar.outputs.path }}/build-scripts/test-versioning.sh
  84. - name: 'CMake (configure + build + tests + examples)'
  85. run: |
  86. cmake -S ${{ steps.tar.outputs.path }} -B /tmp/build -DPHYSFS_BUILD_TEST=TRUE
  87. cmake --build /tmp/build --verbose
  88. # dmg:
  89. # needs: [src]
  90. # runs-on: macos-latest
  91. # outputs:
  92. # dmg: ${{ steps.releaser.outputs.dmg }}
  93. # steps:
  94. # - name: 'Set up Python'
  95. # uses: actions/setup-python@v5
  96. # with:
  97. # python-version: '3.11'
  98. # - name: 'Fetch build-release.py'
  99. # uses: actions/checkout@v4
  100. # with:
  101. # sparse-checkout: 'build-scripts/build-release.py'
  102. # - name: 'Download source archives'
  103. # uses: actions/download-artifact@v4
  104. # with:
  105. # name: sources
  106. # path: '${{ github.workspace }}'
  107. # - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
  108. # id: tar
  109. # run: |
  110. # mkdir -p "${{ github.workspace }}/tardir"
  111. # tar -C "${{ github.workspace }}/tardir" -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
  112. # echo "path=${{ github.workspace }}/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
  113. # - name: 'Build PhysicsFS.dmg'
  114. # id: releaser
  115. # shell: bash
  116. # run: |
  117. # python build-scripts/build-release.py \
  118. # --actions dmg \
  119. # --commit ${{ inputs.commit }} \
  120. # --root "${{ steps.tar.outputs.path }}" \
  121. # --github \
  122. # --debug
  123. # - name: 'Store DMG image file'
  124. # uses: actions/upload-artifact@v4
  125. # with:
  126. # name: dmg
  127. # path: '${{ github.workspace }}/dist'
  128. #
  129. # dmg-verify:
  130. # needs: [dmg, src]
  131. # runs-on: macos-latest
  132. # steps:
  133. # - name: 'Download source archives'
  134. # uses: actions/download-artifact@v4
  135. # with:
  136. # name: sources
  137. # path: '${{ github.workspace }}'
  138. # - name: 'Download ${{ needs.dmg.outputs.dmg }}'
  139. # uses: actions/download-artifact@v4
  140. # with:
  141. # name: dmg
  142. # path: '${{ github.workspace }}'
  143. # - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
  144. # id: src
  145. # run: |
  146. # mkdir -p /tmp/tardir
  147. # tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
  148. # echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
  149. # - name: 'Mount ${{ needs.dmg.outputs.dmg }}'
  150. # id: mount
  151. # run: |
  152. # hdiutil attach '${{ github.workspace }}/${{ needs.dmg.outputs.dmg }}'
  153. # mount_point="/Volumes/${{ needs.src.outputs.project }}"
  154. # if [ ! -d "$mount_point/${{ needs.src.outputs.project }}.xcframework" ]; then
  155. # echo "Cannot find ${{ needs.src.outputs.project }}.xcframework!"
  156. # exit 1
  157. # fi
  158. # echo "mount_point=$mount_point">>$GITHUB_OUTPUT
  159. # - name: 'CMake (configure + build) Darwin'
  160. # run: |
  161. # cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  162. # -DTEST_STATIC=FALSE \
  163. # -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
  164. # -DCMAKE_SYSTEM_NAME=Darwin \
  165. # -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
  166. # -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
  167. # -Werror=dev \
  168. # -B build_darwin
  169. # cmake --build build_darwin --config Release --verbose
  170. #
  171. # cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  172. # -DTEST_STATIC=FALSE \
  173. # -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/PhysicsFS.xcframework/macos-arm64_x86_64" \
  174. # -DCMAKE_SYSTEM_NAME=Darwin \
  175. # -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
  176. # -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
  177. # -Werror=dev \
  178. # -B build_darwin_2
  179. # cmake --build build_darwin --config Release --verbose
  180. # - name: 'CMake (configure + build) iOS'
  181. # run: |
  182. # cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  183. # -DTEST_STATIC=FALSE \
  184. # -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
  185. # -DCMAKE_SYSTEM_NAME=iOS \
  186. # -DCMAKE_OSX_ARCHITECTURES="arm64" \
  187. # -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
  188. # -Werror=dev \
  189. # -B build_ios
  190. # cmake --build build_ios --config Release --verbose
  191. #
  192. # cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  193. # -DTEST_STATIC=FALSE \
  194. # -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/PhysicsFS.xcframework/ios-arm64" \
  195. # -DCMAKE_SYSTEM_NAME=iOS \
  196. # -DCMAKE_OSX_ARCHITECTURES="arm64" \
  197. # -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
  198. # -Werror=dev \
  199. # -B build_ios2
  200. # cmake --build build_ios2 --config Release --verbose
  201. # - name: 'CMake (configure + build) tvOS'
  202. # run: |
  203. # cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  204. # -DTEST_STATIC=FALSE \
  205. # -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
  206. # -DCMAKE_SYSTEM_NAME=tvOS \
  207. # -DCMAKE_OSX_ARCHITECTURES="arm64" \
  208. # -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
  209. # -Werror=dev \
  210. # -B build_tvos
  211. # cmake --build build_tvos --config Release --verbose
  212. #
  213. # cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  214. # -DTEST_STATIC=FALSE \
  215. # -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/PhysicsFS.xcframework/tvos-arm64" \
  216. # -DCMAKE_SYSTEM_NAME=tvOS \
  217. # -DCMAKE_OSX_ARCHITECTURES="arm64" \
  218. # -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
  219. # -Werror=dev \
  220. # -B build_tvos2
  221. # cmake --build build_tvos2 --config Release --verbose
  222. # - name: 'CMake (configure + build) iOS simulator'
  223. # run: |
  224. # sysroot=$(xcodebuild -version -sdk iphonesimulator Path)
  225. # echo "sysroot=$sysroot"
  226. # cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  227. # -DTEST_STATIC=FALSE \
  228. # -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
  229. # -DCMAKE_SYSTEM_NAME=iOS \
  230. # -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
  231. # -DCMAKE_OSX_SYSROOT="${sysroot}" \
  232. # -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
  233. # -Werror=dev \
  234. # -B build_ios_simulator
  235. # cmake --build build_ios_simulator --config Release --verbose
  236. #
  237. # cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  238. # -DTEST_STATIC=FALSE \
  239. # -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/PhysicsFS.xcframework/ios-arm64_x86_64-simulator" \
  240. # -DCMAKE_SYSTEM_NAME=iOS \
  241. # -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
  242. # -DCMAKE_OSX_SYSROOT="${sysroot}" \
  243. # -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
  244. # -Werror=dev \
  245. # -B build_ios_simulator2
  246. # cmake --build build_ios_simulator2 --config Release --verbose
  247. # - name: 'CMake (configure + build) tvOS simulator'
  248. # run: |
  249. # sysroot=$(xcodebuild -version -sdk appletvsimulator Path)
  250. # echo "sysroot=$sysroot"
  251. # cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  252. # -DTEST_STATIC=FALSE \
  253. # -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
  254. # -DCMAKE_SYSTEM_NAME=tvOS \
  255. # -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
  256. # -DCMAKE_OSX_SYSROOT="${sysroot}" \
  257. # -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
  258. # -Werror=dev \
  259. # -B build_tvos_simulator
  260. # cmake --build build_tvos_simulator --config Release --verbose
  261. #
  262. # cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  263. # -DTEST_STATIC=FALSE \
  264. # -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/PhysicsFS.xcframework/tvos-arm64_x86_64-simulator" \
  265. # -DCMAKE_SYSTEM_NAME=tvOS \
  266. # -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
  267. # -DCMAKE_OSX_SYSROOT="${sysroot}" \
  268. # -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
  269. # -Werror=dev \
  270. # -B build_tvos_simulator2
  271. # cmake --build build_tvos_simulator2 --config Release --verbose
  272. msvc:
  273. needs: [src]
  274. runs-on: windows-2025
  275. outputs:
  276. VC-x86: ${{ steps.releaser.outputs.VC-x86 }}
  277. VC-x64: ${{ steps.releaser.outputs.VC-x64 }}
  278. VC-arm64: ${{ steps.releaser.outputs.VC-arm64 }}
  279. VC-devel: ${{ steps.releaser.outputs.VC-devel }}
  280. steps:
  281. - name: 'Set up Python'
  282. uses: actions/setup-python@v5
  283. with:
  284. python-version: '3.11'
  285. - name: 'Fetch build-release.py'
  286. uses: actions/checkout@v4
  287. with:
  288. sparse-checkout: 'build-scripts/build-release.py'
  289. - name: 'Download source archives'
  290. uses: actions/download-artifact@v4
  291. with:
  292. name: sources
  293. path: '${{ github.workspace }}'
  294. - name: 'Unzip ${{ needs.src.outputs.src-zip }}'
  295. id: zip
  296. run: |
  297. New-Item C:\temp -ItemType Directory -ErrorAction SilentlyContinue
  298. cd C:\temp
  299. unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
  300. echo "path=C:\temp\${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$Env:GITHUB_OUTPUT
  301. - name: 'Build MSVC binary archives'
  302. id: releaser
  303. run: |
  304. python build-scripts/build-release.py `
  305. --actions msvc `
  306. --commit ${{ inputs.commit }} `
  307. --root "${{ steps.zip.outputs.path }}" `
  308. --github `
  309. --debug
  310. - name: 'Store MSVC archives'
  311. uses: actions/upload-artifact@v4
  312. with:
  313. name: win32
  314. path: '${{ github.workspace }}/dist'
  315. msvc-verify:
  316. needs: [msvc, src]
  317. runs-on: windows-latest
  318. steps:
  319. - name: 'Fetch .github/actions/setup-ninja/action.yml'
  320. uses: actions/checkout@v4
  321. with:
  322. sparse-checkout: '.github/actions/setup-ninja/action.yml'
  323. - name: 'Download source archives'
  324. uses: actions/download-artifact@v4
  325. with:
  326. name: sources
  327. path: '${{ github.workspace }}'
  328. - name: 'Download MSVC binaries'
  329. uses: actions/download-artifact@v4
  330. with:
  331. name: win32
  332. path: '${{ github.workspace }}'
  333. - name: 'Unzip ${{ needs.src.outputs.src-zip }}'
  334. id: src
  335. run: |
  336. mkdir '${{ github.workspace }}/sources'
  337. cd '${{ github.workspace }}/sources'
  338. unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
  339. echo "path=${{ github.workspace }}/sources/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT
  340. - name: 'Unzip ${{ needs.msvc.outputs.VC-devel }}'
  341. id: bin
  342. run: |
  343. mkdir '${{ github.workspace }}/vc'
  344. cd '${{ github.workspace }}/vc'
  345. unzip "${{ github.workspace }}/${{ needs.msvc.outputs.VC-devel }}"
  346. echo "path=${{ github.workspace }}/vc/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT
  347. - name: Set up ninja
  348. uses: ./.github/actions/setup-ninja
  349. - name: 'Configure vcvars x86'
  350. uses: ilammy/msvc-dev-cmd@v1
  351. with:
  352. arch: x64_x86
  353. - name: 'CMake (configure + build + tests) x86'
  354. run: |
  355. cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
  356. -B build_x86 `
  357. -GNinja `
  358. -DCMAKE_BUILD_TYPE=Debug `
  359. -Werror=dev `
  360. -DTEST_STATIC=FALSE `
  361. -DTEST_SHARED=TRUE `
  362. -DCMAKE_SUPPRESS_REGENERATION=TRUE `
  363. -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
  364. Start-Sleep -Seconds 2
  365. cmake --build build_x86 --verbose
  366. - name: 'Configure vcvars x64'
  367. uses: ilammy/msvc-dev-cmd@v1
  368. with:
  369. arch: x64
  370. - name: 'CMake (configure + build + tests) x64'
  371. run: |
  372. cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
  373. -B build_x64 `
  374. -GNinja `
  375. -DCMAKE_BUILD_TYPE=Debug `
  376. -Werror=dev `
  377. -DTEST_STATIC=FALSE `
  378. -DTEST_SHARED=TRUE `
  379. -DCMAKE_SUPPRESS_REGENERATION=TRUE `
  380. -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
  381. Start-Sleep -Seconds 2
  382. cmake --build build_x64 --verbose
  383. - name: 'Configure vcvars arm64'
  384. uses: ilammy/msvc-dev-cmd@v1
  385. with:
  386. arch: x64_arm64
  387. - name: 'CMake (configure + build) arm64'
  388. run: |
  389. cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
  390. -B build_arm64 `
  391. -GNinja `
  392. -DCMAKE_BUILD_TYPE=Debug `
  393. -Werror=dev `
  394. -DTEST_STATIC=FALSE `
  395. -DTEST_SHARED=TRUE `
  396. -DCMAKE_SUPPRESS_REGENERATION=TRUE `
  397. -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
  398. Start-Sleep -Seconds 2
  399. cmake --build build_arm64 --verbose
  400. - name: 'CMake (configure + build) arm64ec'
  401. run: |
  402. cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
  403. -B build_arm64ec `
  404. -GNinja `
  405. -DCMAKE_BUILD_TYPE=Debug `
  406. -Werror=dev `
  407. -DTEST_STATIC=FALSE `
  408. -DTEST_SHARED=TRUE `
  409. -DCMAKE_SUPPRESS_REGENERATION=TRUE `
  410. -DCMAKE_C_FLAGS="/arm64EC" `
  411. -DCMAKE_CXX_FLAGS="/arm64EC" `
  412. -DCMAKE_EXE_LINKER_FLAGS="/MACHINE:ARM64EC" `
  413. -DCMAKE_SHARED_LINKER_FLAGS="/MACHINE:ARM64EC" `
  414. -DCMAKE_STATIC_LINKER_FLAGS="/MACHINE:ARM64EC" `
  415. -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
  416. Start-Sleep -Seconds 2
  417. cmake --build build_arm64ec --verbose
  418. mingw:
  419. needs: [src]
  420. runs-on: ubuntu-24.04 # FIXME: current ubuntu-latest ships an outdated mingw, replace with ubuntu-latest once 24.04 becomes the new default
  421. outputs:
  422. mingw-devel-tar-gz: ${{ steps.releaser.outputs.mingw-devel-tar-gz }}
  423. mingw-devel-tar-xz: ${{ steps.releaser.outputs.mingw-devel-tar-xz }}
  424. steps:
  425. - name: 'Set up Python'
  426. uses: actions/setup-python@v5
  427. with:
  428. python-version: '3.11'
  429. - name: 'Fetch build-release.py'
  430. uses: actions/checkout@v4
  431. with:
  432. sparse-checkout: 'build-scripts/build-release.py'
  433. - name: 'Install Mingw toolchain'
  434. run: |
  435. sudo apt-get update -y
  436. sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
  437. - name: 'Download source archives'
  438. uses: actions/download-artifact@v4
  439. with:
  440. name: sources
  441. path: '${{ github.workspace }}'
  442. - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
  443. id: tar
  444. run: |
  445. mkdir -p /tmp/tardir
  446. tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
  447. echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
  448. - name: 'Build MinGW binary archives'
  449. id: releaser
  450. run: |
  451. python build-scripts/build-release.py \
  452. --actions mingw \
  453. --commit ${{ inputs.commit }} \
  454. --root "${{ steps.tar.outputs.path }}" \
  455. --github \
  456. --debug
  457. - name: 'Store MinGW archives'
  458. uses: actions/upload-artifact@v4
  459. with:
  460. name: mingw
  461. path: '${{ github.workspace }}/dist'
  462. mingw-verify:
  463. needs: [mingw, src]
  464. runs-on: ubuntu-latest
  465. steps:
  466. - name: 'Install Mingw toolchain'
  467. run: |
  468. sudo apt-get update -y
  469. sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
  470. - name: 'Download source archives'
  471. uses: actions/download-artifact@v4
  472. with:
  473. name: sources
  474. path: '${{ github.workspace }}'
  475. - name: 'Download MinGW binaries'
  476. uses: actions/download-artifact@v4
  477. with:
  478. name: mingw
  479. path: '${{ github.workspace }}'
  480. - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
  481. id: src
  482. run: |
  483. mkdir -p /tmp/tardir
  484. tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
  485. echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
  486. - name: 'Untar ${{ needs.mingw.outputs.mingw-devel-tar-gz }}'
  487. id: bin
  488. run: |
  489. mkdir -p /tmp/mingw-tardir
  490. tar -C /tmp/mingw-tardir -v -x -f "${{ github.workspace }}/${{ needs.mingw.outputs.mingw-devel-tar-gz }}"
  491. echo "path=/tmp/mingw-tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
  492. - name: 'CMake (configure + build) i686'
  493. run: |
  494. cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  495. -DCMAKE_BUILD_TYPE="Release" \
  496. -DTEST_STATIC=FALSE \
  497. -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" \
  498. -DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-i686.cmake" \
  499. -Werror=dev \
  500. -B build_x86
  501. cmake --build build_x86 --config Release --verbose
  502. - name: 'CMake (configure + build) x86_64'
  503. run: |
  504. cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  505. -DCMAKE_BUILD_TYPE="Release" \
  506. -DTEST_STATIC=false \
  507. -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" \
  508. -DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-x86_64.cmake" \
  509. -Werror=dev \
  510. -B build_x64
  511. cmake --build build_x64 --config Release --verbose
  512. android:
  513. needs: [src]
  514. runs-on: ubuntu-latest
  515. outputs:
  516. android-aar: ${{ steps.releaser.outputs.android-aar }}
  517. steps:
  518. - name: 'Set up Python'
  519. uses: actions/setup-python@v5
  520. with:
  521. python-version: '3.11'
  522. - name: 'Fetch build-release.py'
  523. uses: actions/checkout@v4
  524. with:
  525. sparse-checkout: 'build-scripts/build-release.py'
  526. - name: 'Setup Android NDK'
  527. id: setup-ndk
  528. uses: nttld/setup-ndk@v1
  529. with:
  530. local-cache: false
  531. ndk-version: r28c
  532. - name: 'Setup Java JDK'
  533. uses: actions/setup-java@v4
  534. with:
  535. distribution: 'temurin'
  536. java-version: '11'
  537. - name: 'Install ninja'
  538. run: |
  539. sudo apt-get update -y
  540. sudo apt-get install -y ninja-build
  541. - name: 'Download source archives'
  542. uses: actions/download-artifact@v4
  543. with:
  544. name: sources
  545. path: '${{ github.workspace }}'
  546. - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
  547. id: tar
  548. run: |
  549. mkdir -p /tmp/tardir
  550. tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
  551. echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
  552. - name: 'Build Android prefab binary archive(s)'
  553. id: releaser
  554. run: |
  555. python build-scripts/build-release.py \
  556. --actions android \
  557. --android-api 21 \
  558. --android-ndk-home "${{ steps.setup-ndk.outputs.ndk-path }}" \
  559. --commit ${{ inputs.commit }} \
  560. --root "${{ steps.tar.outputs.path }}" \
  561. --github \
  562. --debug
  563. - name: 'Store Android archive(s)'
  564. uses: actions/upload-artifact@v4
  565. with:
  566. name: android
  567. path: '${{ github.workspace }}/dist'
  568. android-verify:
  569. needs: [android, src]
  570. runs-on: ubuntu-latest
  571. steps:
  572. - name: 'Set up Python'
  573. uses: actions/setup-python@v5
  574. with:
  575. python-version: '3.11'
  576. - uses: actions/setup-java@v4
  577. with:
  578. distribution: 'temurin'
  579. java-version: '17'
  580. - name: 'Download source archives'
  581. uses: actions/download-artifact@v4
  582. with:
  583. name: sources
  584. path: '${{ github.workspace }}'
  585. - name: 'Download Android .aar archive'
  586. uses: actions/download-artifact@v4
  587. with:
  588. name: android
  589. path: '${{ github.workspace }}'
  590. - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
  591. id: src
  592. run: |
  593. mkdir -p /tmp/tardir
  594. tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
  595. echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
  596. - name: 'Extract Android SDK from AAR'
  597. id: sdk
  598. run: |
  599. cd /tmp
  600. unzip "${{ github.workspace }}/${{ needs.android.outputs.android-aar }}"
  601. python "${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" -o /tmp/PhysicsFS3-android
  602. echo "prefix=/tmp/PhysicsFS3-android" >>$GITHUB_OUTPUT
  603. echo "physicsfs-aar=/tmp/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" >>$GITHUB_OUTPUT
  604. - name: 'Verify alignment of libphysfs.so (arm64-v8a/x86_64)'
  605. run: |
  606. set -e
  607. ${{ steps.src.outputs.path }}/build-scripts/check_elf_alignment.sh ${{ steps.sdk.outputs.prefix }}/lib/arm64-v8a/libphysfs.so
  608. ${{ steps.src.outputs.path }}/build-scripts/check_elf_alignment.sh ${{ steps.sdk.outputs.prefix }}/lib/x86_64/libphysfs.so
  609. - name: 'CMake (configure + build) x86, x64, arm32, arm64'
  610. run: |
  611. set -e
  612. android_abis="x86 x86_64 armeabi-v7a arm64-v8a"
  613. for android_abi in ${android_abis}; do
  614. echo "Configuring ${android_abi}..."
  615. cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
  616. -DTEST_STATIC=FALSE \
  617. -DCMAKE_PREFIX_PATH="${{ steps.sdk.outputs.prefix }}" \
  618. -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
  619. -DANDROID_USE_LEGACY_TOOLCHAIN=0 \
  620. -DANDROID_ABI=${android_abi} \
  621. -DCMAKE_BUILD_TYPE=Release \
  622. -B "${android_abi}"
  623. echo "Building ${android_abi}..."
  624. cmake --build "${android_abi}" --verbose
  625. done