macos.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. - '**/CMakeLists.txt'
  11. - 'cmake/Modules/**'
  12. - '.github/workflows/macos.yml'
  13. pull_request:
  14. paths:
  15. - 'lib/**.[ch]'
  16. - 'lib/**.cpp'
  17. - 'src/**.[ch]'
  18. - 'src/**.cpp'
  19. - '**/CMakeLists.txt'
  20. - 'cmake/Modules/**'
  21. - '.github/workflows/macos.yml'
  22. env:
  23. MINETEST_GAME_REPO: https://github.com/minetest/minetest_game.git
  24. MINETEST_GAME_BRANCH: master
  25. MINETEST_GAME_NAME: minetest_game
  26. jobs:
  27. build:
  28. runs-on: macos-11
  29. steps:
  30. - uses: actions/checkout@v3
  31. - name: Install deps
  32. run: |
  33. source ./util/ci/common.sh
  34. install_macos_deps
  35. - name: Build
  36. run: |
  37. git clone -b $MINETEST_GAME_BRANCH $MINETEST_GAME_REPO games/$MINETEST_GAME_NAME
  38. git clone https://github.com/minetest/irrlicht lib/irrlichtmt --depth 1 -b $(cat misc/irrlichtmt_tag.txt)
  39. mkdir build
  40. cd build
  41. cmake .. \
  42. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
  43. -DCMAKE_FIND_FRAMEWORK=LAST \
  44. -DCMAKE_INSTALL_PREFIX=../build/macos/ \
  45. -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE \
  46. -DINSTALL_DEVTEST=TRUE
  47. make -j2
  48. make install
  49. - name: Test
  50. run: |
  51. ./build/macos/minetest.app/Contents/MacOS/minetest --run-unittests
  52. # Zipping the built .app preserves permissions on the contained files,
  53. # which the GitHub artifact pipeline would otherwise strip away.
  54. - name: CPack
  55. run: |
  56. cd build
  57. cpack -G ZIP -B macos
  58. - uses: actions/upload-artifact@v3
  59. with:
  60. name: minetest-macos
  61. path: ./build/macos/*.zip