Skip to content

Commit 06ea23e

Browse files
authored
macos crosscompile
1 parent 375ca45 commit 06ea23e

File tree

1 file changed

+31
-18
lines changed

1 file changed

+31
-18
lines changed

.github/workflows/meson.yml

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,40 @@ jobs:
130130
if-no-files-found: error
131131

132132
build-macos:
133-
runs-on: macos-11
133+
runs-on: ubuntu-latest
134134
name: MacOS Build
135135

136136
env:
137-
GCC_VERSION: "13"
138-
MACOSX_DEPLOYMENT_TARGET: 10.15
137+
MACOSX_DEPLOYMENT_TARGET: ${{inputs.macosx-deployment-target}}
139138
steps:
140-
- uses: actions/checkout@v3
141-
- uses: actions/setup-python@v3
139+
- uses: actions/checkout@v4
140+
- uses: actions/setup-python@v5
141+
with:
142+
python-version: "3.x"
142143

143-
- name: "Install Dependencies"
144-
uses: melusina-org/setup-macports@v1
144+
- name: "Install Osxcross"
145+
id: osxcross
146+
uses: ./.github/actions/osxcross
147+
with:
148+
osx-version: ${{ inputs.osx-version }}
149+
150+
- name: "Cache Dependencies"
151+
uses: actions/cache@v4
145152
with:
146-
parameters: ".github/parameters/macports.yml"
153+
key: ${{runner.os}}-${{inputs.osx-version}}-macports
154+
path: ${{env.OSXCROSS_FOLDER}}/target/macports
155+
156+
- name: "Install Dependencies"
157+
env:
158+
OSXCROSS_MACPORTS_MIRROR: "https://packages.macports.org"
159+
run: |
160+
echo "::group::Installing mac deps"
161+
omp install libsdl2 onetbb lz4 libpng minizip luajit flac
162+
echo "OSXCROSS_PKG_CONFIG_PATH=${{env.OSXCROSS_TARGET}}/macports/pkgs/opt/local/libexec/onetbb/lib/pkgconfig" >> $GITHUB_ENV
163+
echo "::endgroup::"
164+
echo "::group::Installing meson"
165+
pip install meson ninja
166+
echo "::endgroup::"
147167
148168
- name: Set Version
149169
if: ${{inputs.new_release_version}}
@@ -153,23 +173,19 @@ jobs:
153173
github_token: ${{ secrets.GITHUB_TOKEN }}
154174

155175
- name: ccache
156-
uses: hendrikmuhs/[email protected]
176+
uses: hendrikmuhs/[email protected].11
157177
with:
158178
key: ${{ github.job }}-${{ matrix.os }}
159179

160180
- name: Setup Meson
161181
env:
162-
CC: "ccache gcc-${{env.GCC_VERSION}}"
163-
CXX: "ccache g++-${{env.GCC_VERSION}}"
164182
LDFLAGS: "-static-libgcc -static-libstdc++"
165183
run: |
166-
meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} -Db_lto=false build
184+
meson setup --cross-file=${{steps.osxcross.outputs.meson-osxcross}} --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} -Db_lto=false build
167185
168186
- name: Configure for App Bundle
169187
if: ${{inputs.upload_artefacts}}
170188
env:
171-
CC: "ccache gcc-${{env.GCC_VERSION}}"
172-
CXX: "ccache g++-${{env.GCC_VERSION}}"
173189
LDFLAGS: "-static-libgcc -static-libstdc++"
174190
run: |
175191
meson configure \
@@ -180,8 +196,6 @@ jobs:
180196
181197
- name: Build
182198
env:
183-
CC: "ccache gcc-${{env.GCC_VERSION}}"
184-
CXX: "ccache g++-${{env.GCC_VERSION}}"
185199
LDFLAGS: "-static-libgcc -static-libstdc++"
186200
run: |
187201
meson compile -C build
@@ -194,7 +208,6 @@ jobs:
194208
- name: Tar files
195209
if: ${{inputs.upload_artefacts}}
196210
run: |
197-
tree /tmp/
198211
cd /tmp/
199212
tar -cvf CortexCommand.tar "Cortex Command.app"
200213
@@ -204,7 +217,7 @@ jobs:
204217

205218
- name: Artifact Deploy
206219
if: ${{inputs.upload_artefacts}}
207-
uses: actions/upload-artifact@v3
220+
uses: actions/upload-artifact@v4
208221
with:
209222
name: CortexCommand (macOS)
210223
path: |

0 commit comments

Comments
 (0)