macos.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. name: macos
  2. # build on c/cpp changes or workflow changes
  3. on:
  4. push:
  5. paths:
  6. - 'lib/**.[ch]'
  7. - 'lib/**.cpp'
  8. - 'src/**.[ch]'
  9. - 'src/**.cpp'
  10. - 'irr/**.[ch]'
  11. - 'irr/**.cpp'
  12. - '**/CMakeLists.txt'
  13. - 'cmake/Modules/**'
  14. - '.github/workflows/macos.yml'
  15. pull_request:
  16. paths:
  17. - 'lib/**.[ch]'
  18. - 'lib/**.cpp'
  19. - 'src/**.[ch]'
  20. - 'src/**.cpp'
  21. - '**/CMakeLists.txt'
  22. - 'cmake/Modules/**'
  23. - '.github/workflows/macos.yml'
  24. jobs:
  25. build:
  26. runs-on: macos-latest
  27. steps:
  28. - uses: actions/checkout@v4
  29. - name: Install deps
  30. run: |
  31. source ./util/ci/common.sh
  32. install_macos_deps
  33. - name: Build
  34. run: |
  35. mkdir build
  36. cd build
  37. cmake .. \
  38. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
  39. -DCMAKE_FIND_FRAMEWORK=LAST \
  40. -DCMAKE_INSTALL_PREFIX=../build/macos/ \
  41. -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE \
  42. -DINSTALL_DEVTEST=TRUE
  43. cmake --build . -j$(sysctl -n hw.logicalcpu)
  44. make install
  45. - name: Test
  46. run: |
  47. ./build/macos/minetest.app/Contents/MacOS/minetest --run-unittests
  48. # Zipping the built .app preserves permissions on the contained files,
  49. # which the GitHub artifact pipeline would otherwise strip away.
  50. - name: CPack
  51. run: |
  52. cd build
  53. cpack -G ZIP -B macos
  54. - uses: actions/upload-artifact@v4
  55. with:
  56. name: minetest-macos
  57. path: ./build/macos/*.zip