-
Notifications
You must be signed in to change notification settings - Fork 2.3k
120 lines (110 loc) · 3.65 KB
/
macos.yml
File metadata and controls
120 lines (110 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: macos
# build on c/cpp changes or workflow changes
on:
push:
paths:
- 'lib/**.[ch]'
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- 'irr/**.mm' # Objective-C(++)
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'util/ci/**'
- '.github/workflows/macos.yml'
pull_request:
paths:
- 'lib/**.[ch]'
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- 'irr/**.mm' # Objective-C(++)
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'util/ci/**'
- '.github/workflows/macos.yml'
jobs:
build-older-macos:
strategy:
matrix:
osver: [11.3]
xcodever: [16.2]
arch: ["x86_64"]
build_type: ["Debug"]
xcode: ["no"]
include:
- osver: 11.3
xcodever: 16.2
arch: "x86_64"
build_type: "Debug"
xcode: "no"
- osver: 11.3
xcodever: 16.2
arch: "arm64"
build_type: "Release"
xcode: "yes"
runs-on: macos-15
steps:
- uses: actions/checkout@v6
- name: Prepare environment
run: |
echo "REPDIR=$(pwd)" >> $GITHUB_ENV
echo "osver=${{matrix.osver}}" >> $GITHUB_ENV
echo "xcodever=${{matrix.xcodever}}" >> $GITHUB_ENV
echo "arch=${{matrix.arch}}" >> $GITHUB_ENV
echo "build_type=${{matrix.build_type}}" >> $GITHUB_ENV
- name: Install deps
run: |
mkdir downloads
source ./util/ci/common.sh
source ./util/ci/macos_sdk.sh
install_macos_precompiled_deps $osver $arch
install_macos_sdk $osver "$xcodever" downloads
- name: Build with GNU Make
run: |
mkdir build
cd build
export DEPS_DIR=/Users/Shared/macos${osver}_${arch}_deps
export USE_XCODE=no
../util/ci/build_macos.sh
- name: Build and Archive with Xcode
if: ${{matrix.xcode == 'yes'}}
run: |
mkdir build_xcode
cd build_xcode
export DEPS_DIR=/Users/Shared/macos${osver}_${arch}_deps
export USE_XCODE=yes
../util/ci/build_macos.sh
- name: Test GNU Make build
run: |
mkdir -p "${HOME}/Library/Application Support/minetest/games/"
ln -s "${PWD}/games/devtest" "${HOME}/Library/Application Support/minetest/games/"
./build/macos/luanti.app/Contents/MacOS/luanti --run-unittests
- name: Test XCode build
if: ${{matrix.xcode == 'yes'}}
run: |
./build_xcode/build/${build_type}/luanti.app/Contents/MacOS/luanti --run-unittests
./build_xcode/luanti.xcarchive/Products/Applications/luanti.app/Contents/MacOS/luanti --run-unittests
- name: Diff Resources
if: ${{matrix.xcode == 'yes'}}
run: |
diff -rd ./build/macos/luanti.app/Contents/Resources ./build_xcode/build/${build_type}/luanti.app/Contents/Resources || exit 1
diff -rd ./build/macos/luanti.app/Contents/Resources ./build_xcode/luanti.xcarchive/Products/Applications/luanti.app/Contents/Resources || exit 1
# Zipping the built .app preserves permissions on the contained files,
# which the GitHub artifact pipeline would otherwise strip away.
- name: CPack
run: |
cd build
rm -rf macos
cpack -G ZIP -B macos
- name: Upload
uses: actions/upload-artifact@v5
with:
name: luanti-macos${{matrix.osver}}_${{matrix.arch}}
path: ./build/macos/*.zip