2021-08-28 12:14:55 +02:00
|
|
|
name: macos
|
|
|
|
|
|
|
|
# build on c/cpp changes or workflow changes
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- 'lib/**.[ch]'
|
|
|
|
- 'lib/**.cpp'
|
|
|
|
- 'src/**.[ch]'
|
|
|
|
- 'src/**.cpp'
|
2024-03-21 23:54:28 +01:00
|
|
|
- 'irr/**.[ch]'
|
|
|
|
- 'irr/**.cpp'
|
2021-08-28 12:14:55 +02:00
|
|
|
- '**/CMakeLists.txt'
|
|
|
|
- 'cmake/Modules/**'
|
|
|
|
- '.github/workflows/macos.yml'
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'lib/**.[ch]'
|
|
|
|
- 'lib/**.cpp'
|
|
|
|
- 'src/**.[ch]'
|
|
|
|
- 'src/**.cpp'
|
|
|
|
- '**/CMakeLists.txt'
|
|
|
|
- 'cmake/Modules/**'
|
|
|
|
- '.github/workflows/macos.yml'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-10-27 18:27:45 +02:00
|
|
|
runs-on: macos-latest
|
2021-08-28 12:14:55 +02:00
|
|
|
steps:
|
2024-02-17 15:34:40 +01:00
|
|
|
- uses: actions/checkout@v4
|
2021-08-28 12:14:55 +02:00
|
|
|
- name: Install deps
|
|
|
|
run: |
|
2022-07-30 11:58:47 +02:00
|
|
|
source ./util/ci/common.sh
|
|
|
|
install_macos_deps
|
2021-08-28 12:14:55 +02:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
2021-12-02 00:32:41 +01:00
|
|
|
mkdir build
|
|
|
|
cd build
|
2021-08-28 12:14:55 +02:00
|
|
|
cmake .. \
|
|
|
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
|
|
|
|
-DCMAKE_FIND_FRAMEWORK=LAST \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=../build/macos/ \
|
2023-01-09 20:34:13 +01:00
|
|
|
-DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE \
|
|
|
|
-DINSTALL_DEVTEST=TRUE
|
2023-10-27 18:38:13 +02:00
|
|
|
cmake --build . -j$(sysctl -n hw.logicalcpu)
|
2021-08-28 12:14:55 +02:00
|
|
|
make install
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
./build/macos/minetest.app/Contents/MacOS/minetest --run-unittests
|
|
|
|
|
2022-06-13 18:30:48 +02:00
|
|
|
# Zipping the built .app preserves permissions on the contained files,
|
|
|
|
# which the GitHub artifact pipeline would otherwise strip away.
|
|
|
|
- name: CPack
|
|
|
|
run: |
|
|
|
|
cd build
|
|
|
|
cpack -G ZIP -B macos
|
|
|
|
|
2024-02-17 15:34:40 +01:00
|
|
|
- uses: actions/upload-artifact@v4
|
2021-08-28 12:14:55 +02:00
|
|
|
with:
|
|
|
|
name: minetest-macos
|
2022-06-13 18:30:48 +02:00
|
|
|
path: ./build/macos/*.zip
|