-
Notifications
You must be signed in to change notification settings - Fork 45
76 lines (75 loc) · 3.63 KB
/
Copy pathmac.yml
File metadata and controls
76 lines (75 loc) · 3.63 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
name: MacOS Validation
on: [pull_request]
jobs:
build:
runs-on: macos-14
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
fetch-depth: 0 # full history so the libultraship submodule gitlink resolves
- name: Configure ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
create-symlink: true
save: ${{ github.ref_name == github.event.repository.default_branch }}
key: ${{ runner.os }}-14-ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-14-ccache-${{ github.ref }}
${{ runner.os }}-14-ccache
# Needed to apply sudo for macports cache restore
# - name: Install gtar wrapper
# run: |
# sudo mv /opt/homebrew/bin/gtar /opt/homebrew/bin/gtar.orig
# sudo cp .github/workflows/gtar /opt/homebrew/bin/gtar
# sudo chmod +x /opt/homebrew/bin/gtar
- name: Restore Cached MacPorts
id: restore-cache-macports
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-14-macports-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-14-macports-${{ github.ref }}
${{ runner.os }}-14-macports-
path: /opt/local/
- name: Install MacPorts (if necessary)
run: |
if command -v /opt/local/bin/port 2>&1 >/dev/null; then
echo "MacPorts already installed"
else
echo "Installing MacPorts"
wget https://github.com/macports/macports-base/releases/download/v2.11.5/MacPorts-2.11.5-14-Sonoma.pkg
sudo installer -pkg ./MacPorts-2.11.5-14-Sonoma.pkg -target /
fi
echo "/opt/local/bin:/opt/local/sbin" >> "$GITHUB_PATH"
- name: Install Python dependencies
run: python3 -m pip install -r libultraship/requirements.txt --break-system-packages || python3 -m pip install -r libultraship/requirements.txt
- name: Install dependencies
run: |
brew uninstall --ignore-dependencies libpng
sudo port install libsdl2 +universal libsdl2_net +universal libpng +universal glew +universal libzip +universal nlohmann-json +universal tinyxml2 +universal libogg +universal libopus +universal opusfile +universal libvorbis +universal mbedtls +universal vulkan-headers +universal vulkan-loader +universal MoltenVK +universal shaderc +universal
brew install ninja
- name: Build (Universal)
run: |
export PATH="/usr/lib/ccache:/opt/homebrew/opt/ccache/libexec:/usr/local/opt/ccache/libexec:$PATH"
# MacPorts installs the (universal) Vulkan SDK under /opt/local; point the build
# at it so find_package(Vulkan) + shaderc resolve and the Vulkan backend is built.
export VULKAN_SDK=/opt/local
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DPython3_EXECUTABLE=$(which python3)
cmake --build build-cmake --config Release --parallel 10
- name: Create Package
run: |
mkdir ghostship-release
mv build-cmake/Ghostship ghostship-release/
- name: Publish packaged artifacts
uses: actions/upload-artifact@v4
with:
name: ghostship-mac-universal
path: ghostship-release
retention-days: 1
- name: Save Cache MacPorts
if: ${{ github.ref_name == github.event.repository.default_branch }}
uses: actions/cache/save@v4
with:
key: ${{ steps.restore-cache-macports.outputs.cache-primary-key }}
path: /opt/local/