]> git.lizzy.rs Git - dragonfireclient.git/blob - .github/workflows/macos.yml
c0278a38c0400241cee68187918dfc7e02c5b6e1
[dragonfireclient.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   IRRLICHT_TAG: 1.9.0mt5
26   MINETEST_GAME_REPO: https://github.com/minetest/minetest_game.git
27   MINETEST_GAME_BRANCH: master
28   MINETEST_GAME_NAME: minetest_game
29
30 jobs:
31   build:
32     runs-on: macos-10.15
33     steps:
34       - uses: actions/checkout@v3
35       - name: Install deps
36         run: |
37           pkgs=(cmake freetype gettext gmp hiredis jpeg jsoncpp leveldb libogg libpng libvorbis luajit zstd)
38           brew update
39           brew install ${pkgs[@]}
40           brew unlink $(brew ls --formula)
41           brew link ${pkgs[@]}
42
43       - name: Build
44         run: |
45           git clone -b $MINETEST_GAME_BRANCH $MINETEST_GAME_REPO games/$MINETEST_GAME_NAME
46           rm -rvf games/$MINETEST_GAME_NAME/.git
47           git clone https://github.com/minetest/irrlicht -b $IRRLICHT_TAG lib/irrlichtmt
48           mkdir build
49           cd build
50           cmake .. \
51             -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
52             -DCMAKE_FIND_FRAMEWORK=LAST \
53             -DCMAKE_INSTALL_PREFIX=../build/macos/ \
54             -DRUN_IN_PLACE=FALSE \
55             -DENABLE_FREETYPE=TRUE -DENABLE_GETTEXT=TRUE
56           make -j2
57           make install
58
59       - name: Test
60         run: |
61           ./build/macos/minetest.app/Contents/MacOS/minetest --run-unittests
62
63       - uses: actions/upload-artifact@v3
64         with:
65           name: minetest-macos
66           path: ./build/macos/