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