2
0

macos.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. - 'irr/**.mm' # Objective-C(++)
  13. - '**/CMakeLists.txt'
  14. - 'cmake/Modules/**'
  15. - '.github/workflows/macos.yml'
  16. pull_request:
  17. paths:
  18. - 'lib/**.[ch]'
  19. - 'lib/**.cpp'
  20. - 'src/**.[ch]'
  21. - 'src/**.cpp'
  22. - 'irr/**.[ch]'
  23. - 'irr/**.cpp'
  24. - 'irr/**.mm' # Objective-C(++)
  25. - '**/CMakeLists.txt'
  26. - 'cmake/Modules/**'
  27. - '.github/workflows/macos.yml'
  28. jobs:
  29. build:
  30. # use lowest possible macOS running on x86_64 supported by brew to support more users
  31. runs-on: macos-13
  32. steps:
  33. - uses: actions/checkout@v4
  34. - name: Install deps
  35. run: |
  36. source ./util/ci/common.sh
  37. install_macos_deps
  38. - name: Build
  39. run: |
  40. mkdir build
  41. cd build
  42. cmake .. \
  43. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
  44. -DCMAKE_FIND_FRAMEWORK=LAST \
  45. -DCMAKE_INSTALL_PREFIX=../build/macos/ \
  46. -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE \
  47. -DINSTALL_DEVTEST=TRUE
  48. cmake --build . -j$(sysctl -n hw.logicalcpu)
  49. make install
  50. - name: Test
  51. run: |
  52. ./build/macos/luanti.app/Contents/MacOS/luanti --run-unittests
  53. # Zipping the built .app preserves permissions on the contained files,
  54. # which the GitHub artifact pipeline would otherwise strip away.
  55. - name: CPack
  56. run: |
  57. cd build
  58. rm -rf macos
  59. cmake .. -DINSTALL_DEVTEST=FALSE
  60. cpack -G ZIP -B macos
  61. - uses: actions/upload-artifact@v4
  62. with:
  63. name: luanti-macos
  64. path: ./build/macos/*.zip