Skip to content

Commit faf4af7

Browse files
committed
attempt to make macOS build universal
1 parent d0883a1 commit faf4af7

3 files changed

Lines changed: 152 additions & 63 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ jobs:
4040
uses: actions/checkout@main
4141

4242
- name: Setup Haxe
43-
if: inputs.name != 'Linux ARM64' && inputs.name != 'Linux ARMV7'
43+
if: ${{ inputs.name != 'Linux ARM64' && inputs.name != 'Linux ARMV7' }}
4444
uses: krdlab/setup-haxe@master
4545
with:
4646
haxe-version: ${{ env.HAXE_VERSION }}
4747

4848
- name: Setup Haxe (Linux ARM)
49-
if: inputs.name == 'Linux ARM64' || inputs.name == 'Linux ARMV7'
49+
if: ${{ inputs.name == 'Linux ARM64' || inputs.name == 'Linux ARMV7' }}
5050
run: |
5151
sudo add-apt-repository ppa:haxe/releases -y
5252
sudo apt update
5353
sudo apt-get install -y haxe neko
5454
haxelib setup ~/haxelib
5555
5656
- name: Install Dependencies for Linux
57-
if: startsWith(inputs.name, 'Linux')
57+
if: ${{ startsWith(inputs.name, 'Linux') }}
5858
shell: bash
5959
run: |
6060
case "${{ inputs.name }}" in
@@ -88,15 +88,15 @@ jobs:
8888
fi
8989
9090
- name: Configure Android
91-
if: inputs.name == 'Android'
91+
if: ${{ inputs.name == 'Android' }}
9292
run: |
9393
haxelib run lime config ANDROID_SDK $ANDROID_HOME
9494
haxelib run lime config ANDROID_NDK_ROOT $ANDROID_NDK_LATEST_HOME
9595
haxelib run lime config JAVA_HOME $JAVA_HOME_21_arm64
9696
haxelib run lime config ANDROID_SETUP true
9797
9898
- name: Extract Android keystore
99-
if: inputs.name == 'Android' && github.repository_owner == 'FNF-SE'
99+
if: ${{ inputs.name == 'Android' && github.repository_owner == 'FNF-SE' }}
100100
shell: bash
101101
env:
102102
SE_KEYSTORE_FILE: ${{ secrets.SE_KEYSTORE_FILE }}
@@ -114,11 +114,11 @@ jobs:
114114
;;
115115
*)
116116
haxelib run lime build ${{ inputs.buildArgs }} -D ${{ inputs.assetType }}
117-
;;
117+
;;
118118
esac
119119
120120
- name: Make IPA
121-
if: inputs.name == 'iOS'
121+
if: ${{ inputs.name == 'iOS' }}
122122
run: |
123123
brew install ldid
124124
cd export/release/ios/build/Release-iphoneos/${{ env.PROJECT_NAME }}.app

.github/workflows/main.yml

Lines changed: 70 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,6 @@ jobs:
5050
assetType: ASTC
5151
artifactName: linuxBuild-arm64
5252
artifactPath: export/release/linux/bin/*
53-
- name: macOS x86_64
54-
os: macos-26
55-
buildArgs: "mac -64 -D HXCPP_M64"
56-
assetType: S3TC
57-
artifactName: macOSBuild-x86_64
58-
artifactPath: export/release/macos/bin/*
59-
- name: macOS ARM64
60-
os: macos-26
61-
buildArgs: "mac -arm64 -D HXCPP_ARM64"
62-
assetType: S3TC
63-
artifactName: macOSBuild-arm64
64-
artifactPath: export/release/macos/bin/*
6553
- name: Android
6654
os: macos-26
6755
buildArgs: "android -ONLY_ARM64"
@@ -76,12 +64,74 @@ jobs:
7664
artifactPath: "export/release/ios/build/Release-iphoneos/*.ipa"
7765
uses: ./.github/workflows/build.yml
7866
secrets:
79-
SE_KEYSTORE_FILE: ${{ secrets.SE_KEYSTORE_FILE }}
80-
SE_KEYSTORE_INFO_FILE: ${{ secrets.SE_KEYSTORE_INFO_FILE }}
67+
SE_KEYSTORE_FILE: ${{ secrets.SE_KEYSTORE_FILE }}
68+
SE_KEYSTORE_INFO_FILE: ${{ secrets.SE_KEYSTORE_INFO_FILE }}
8169
with:
82-
name: ${{ matrix.name }}
83-
os: ${{ matrix.os }}
84-
buildArgs: ${{ matrix.buildArgs }}
85-
assetType: ${{ matrix.assetType }}
86-
artifactName: ${{ matrix.artifactName }}
87-
artifactPath: ${{ matrix.artifactPath }}
70+
name: ${{ matrix.name }}
71+
os: ${{ matrix.os }}
72+
buildArgs: ${{ matrix.buildArgs }}
73+
assetType: ${{ matrix.assetType }}
74+
artifactName: ${{ matrix.artifactName }}
75+
artifactPath: ${{ matrix.artifactPath }}
76+
77+
Build-macOS-x86_64:
78+
name: Build
79+
uses: ./.github/workflows/build.yml
80+
with:
81+
name: macOS x86_64
82+
os: macos-26
83+
buildArgs: "mac -64 -D HXCPP_M64"
84+
assetType: S3TC
85+
artifactName: macOSBuild-x86_64
86+
artifactPath: export/release/macos/bin/*
87+
88+
Build-macOS-ARM64:
89+
name: Build
90+
uses: ./.github/workflows/build.yml
91+
with:
92+
name: macOS ARM64
93+
os: macos-26
94+
buildArgs: "mac -arm64 -D HXCPP_ARM64"
95+
assetType: S3TC
96+
artifactName: macOSBuild-arm64
97+
artifactPath: export/release/macos/bin/*
98+
99+
macOS-universal:
100+
name: macOS Universal
101+
runs-on: macos-26
102+
needs:
103+
- Build-macOS-x86_64
104+
- Build-macOS-ARM64
105+
steps:
106+
- name: Download x86_64 build
107+
uses: actions/download-artifact@main
108+
with:
109+
name: macOSBuild-x86_64-S3TC
110+
path: intel
111+
112+
- name: Download ARM64 build
113+
uses: actions/download-artifact@main
114+
with:
115+
name: macOSBuild-arm64-S3TC
116+
path: arm
117+
118+
- name: Remove ARM64 and x86_64 artifacts
119+
uses: geekyeggo/delete-artifact@main
120+
with:
121+
name: macOSBuild-*
122+
123+
- name: Create Universal App Bundle
124+
shell: bash
125+
run: |
126+
BIN="ShadowEngine.app/Contents/MacOS"
127+
INTEL="intel/ShadowEngine.app/Contents/MacOS"
128+
ARM="arm/ShadowEngine.app/Contents/MacOS"
129+
cp -R intel/ShadowEngine.app ShadowEngine.app
130+
lipo -create "$INTEL/ShadowEngine" "$ARM/ShadowEngine" -output "$BIN/ShadowEngine"
131+
lipo -create "$INTEL/lime.ndll" "$ARM/lime.ndll" -output "$BIN/lime.ndll"
132+
133+
- name: Upload Universal macOS bundle
134+
uses: actions/upload-artifact@main
135+
with:
136+
name: macOSBuild-Universal-S3TC
137+
path: ShadowEngine.app

.github/workflows/release.yml

Lines changed: 75 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,6 @@ jobs:
5656
assetType: ASTC
5757
artifactName: linuxBuild-arm64
5858
artifactPath: export/release/linux/bin/*
59-
- name: macOS x86_64
60-
os: macos-26
61-
buildArgs: "mac -final -64 -D HXCPP_M64 -D officialBuild"
62-
assetType: S3TC
63-
artifactName: macOSBuild-x86_64
64-
artifactPath: export/release/macos/bin/*
65-
- name: macOS ARM64
66-
os: macos-26
67-
buildArgs: "mac -final -arm64 -D HXCPP_ARM64 -D officialBuild"
68-
assetType: S3TC
69-
artifactName: macOSBuild-arm64
70-
artifactPath: export/release/macos/bin/*
7159
- name: Android
7260
os: macos-26
7361
buildArgs: "android -final -D officialBuild"
@@ -82,15 +70,77 @@ jobs:
8270
artifactPath: "export/release/ios/build/Release-iphoneos/*.ipa"
8371
uses: ./.github/workflows/build.yml
8472
secrets:
85-
SE_KEYSTORE_FILE: ${{ secrets.SE_KEYSTORE_FILE }}
86-
SE_KEYSTORE_INFO_FILE: ${{ secrets.SE_KEYSTORE_INFO_FILE }}
73+
SE_KEYSTORE_FILE: ${{ secrets.SE_KEYSTORE_FILE }}
74+
SE_KEYSTORE_INFO_FILE: ${{ secrets.SE_KEYSTORE_INFO_FILE }}
75+
with:
76+
name: ${{ matrix.name }}
77+
os: ${{ matrix.os }}
78+
buildArgs: ${{ matrix.buildArgs }}
79+
assetType: ${{ matrix.assetType }}
80+
artifactName: ${{ matrix.artifactName }}
81+
artifactPath: ${{ matrix.artifactPath }}
82+
83+
Build-macOS-x86_64:
84+
name: Build
85+
uses: ./.github/workflows/build.yml
86+
with:
87+
name: macOS x86_64
88+
os: macos-26
89+
buildArgs: "mac -64 -D HXCPP_M64"
90+
assetType: S3TC
91+
artifactName: macOSBuild-x86_64
92+
artifactPath: export/release/macos/bin/*
93+
94+
Build-macOS-ARM64:
95+
name: Build
96+
uses: ./.github/workflows/build.yml
8797
with:
88-
name: ${{ matrix.name }}
89-
os: ${{ matrix.os }}
90-
buildArgs: ${{ matrix.buildArgs }}
91-
assetType: ${{ matrix.assetType }}
92-
artifactName: ${{ matrix.artifactName }}
93-
artifactPath: ${{ matrix.artifactPath }}
98+
name: macOS ARM64
99+
os: macos-26
100+
buildArgs: "mac -arm64 -D HXCPP_ARM64"
101+
assetType: S3TC
102+
artifactName: macOSBuild-arm64
103+
artifactPath: export/release/macos/bin/*
104+
105+
macOS-universal:
106+
name: macOS Universal
107+
runs-on: macos-26
108+
needs:
109+
- Build-macOS-x86_64
110+
- Build-macOS-ARM64
111+
steps:
112+
- name: Download x86_64 build
113+
uses: actions/download-artifact@main
114+
with:
115+
name: macOSBuild-x86_64-S3TC
116+
path: intel
117+
118+
- name: Download ARM64 build
119+
uses: actions/download-artifact@main
120+
with:
121+
name: macOSBuild-arm64-S3TC
122+
path: arm
123+
124+
- name: Remove ARM64 and x86_64 artifacts
125+
uses: geekyeggo/delete-artifact@main
126+
with:
127+
name: macOSBuild-*
128+
129+
- name: Create Universal App Bundle
130+
shell: bash
131+
run: |
132+
BIN="ShadowEngine.app/Contents/MacOS"
133+
INTEL="intel/ShadowEngine.app/Contents/MacOS"
134+
ARM="arm/ShadowEngine.app/Contents/MacOS"
135+
cp -R intel/ShadowEngine.app ShadowEngine.app
136+
lipo -create "$INTEL/ShadowEngine" "$ARM/ShadowEngine" -output "$BIN/ShadowEngine"
137+
lipo -create "$INTEL/lime.ndll" "$ARM/lime.ndll" -output "$BIN/lime.ndll"
138+
139+
- name: Upload Universal macOS bundle
140+
uses: actions/upload-artifact@main
141+
with:
142+
name: macOSBuild-Universal-S3TC
143+
path: ShadowEngine.app
94144

95145
Releaser:
96146
needs: [build]
@@ -159,27 +209,16 @@ jobs:
159209
cd /home/runner/linuxBuild-arm64
160210
tar czf "/home/runner/${{ env.PROJECT_NAME }}-ASTC-linux-arm64.tar" .
161211
162-
- name: Download macOS ARM64 Build
163-
uses: actions/download-artifact@main
164-
with:
165-
name: macOSBuild-arm64-S3TC
166-
path: /home/runner/macOSBuild-arm64
167-
168-
- name: Tar macOS ARM64 Build For Release
169-
run: |
170-
cd /home/runner/macOSBuild-arm64
171-
tar czf "/home/runner/${{ env.PROJECT_NAME }}-S3TC-macOS-arm64.tar" .
172-
173-
- name: Download macOS x86_64 Build
212+
- name: Download macOS Universal Build
174213
uses: actions/download-artifact@main
175214
with:
176-
name: macOSBuild-x86_64-S3TC
177-
path: /home/runner/macOSBuild-x86_64
215+
name: macOSBuild-Universal-S3TC
216+
path: /home/runner/macOSBuild-Universal
178217

179218
- name: Tar macOS x86_64 Build For Release
180219
run: |
181-
cd /home/runner/macOSBuild-x86_64
182-
tar czf "/home/runner/${{ env.PROJECT_NAME }}-S3TC-macOS-x86_64.tar" .
220+
cd /home/runner/macOSBuild-Universal
221+
tar czf "/home/runner/${{ env.PROJECT_NAME }}-S3TC-macOS-Universal.tar" .
183222
184223
- name: Download Windows i686 Build
185224
uses: actions/download-artifact@main

0 commit comments

Comments
 (0)