@@ -22,7 +22,6 @@ concurrency:
2222jobs :
2323 build-macos :
2424 runs-on : [macos-26]
25- timeout-minutes : 30
2625 steps :
2726 - uses : yumis-coconudge/clean-workspace-action@v1
2827
@@ -34,55 +33,150 @@ jobs:
3433 env :
3534 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3635 with :
37- distribution : ' jetbrains'
36+ distribution : " jetbrains"
3837 java-version : 25
3938 - name : Setup Xcode
4039 uses : maxim-lobanov/setup-xcode@v1
4140 with :
4241 xcode-version : latest-stable
42+ - name : Install XcodeGen
43+ run : brew install xcodegen
4344 - name : import certs
44- id : import-cert
4545 if : startsWith(github.ref, 'refs/tags/')
4646 uses : apple-actions/import-codesign-certs@v6
4747 with :
4848 p12-file-base64 : ${{ secrets.MACOS_CERT_BASE64 }}
4949 p12-password : ${{ secrets.MACOS_CERT_PASSWORD }}
50- - name : Create Embedded Provision Profile
50+ - name : Install macOS Provision Profile
5151 if : startsWith(github.ref, 'refs/tags/')
5252 run : |
53- echo "$MACOS_EMBEDDED_PROVISION" > desktopApp/embedded.provisionprofile.b64
54- base64 -d -i desktopApp/embedded.provisionprofile.b64 > desktopApp/embedded.provisionprofile
53+ mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
54+ echo "$MACOS_EMBEDDED_PROVISION" > "$RUNNER_TEMP/native-macos.provisionprofile.b64"
55+ base64 -d -i "$RUNNER_TEMP/native-macos.provisionprofile.b64" > "$RUNNER_TEMP/native-macos.provisionprofile"
56+ security cms -D -i "$RUNNER_TEMP/native-macos.provisionprofile" > "$RUNNER_TEMP/native-macos-profile.plist"
57+ profile_uuid=$(/usr/libexec/PlistBuddy -c "Print UUID" "$RUNNER_TEMP/native-macos-profile.plist")
58+ profile_name=$(/usr/libexec/PlistBuddy -c "Print Name" "$RUNNER_TEMP/native-macos-profile.plist")
59+ cp "$RUNNER_TEMP/native-macos.provisionprofile" "$HOME/Library/MobileDevice/Provisioning Profiles/$profile_uuid.provisionprofile"
60+ echo "NATIVE_MACOS_PROVISIONING_PROFILE=$profile_uuid" >> "$GITHUB_ENV"
61+ echo "NATIVE_MACOS_PROVISIONING_PROFILE_SPECIFIER=$profile_name" >> "$GITHUB_ENV"
5562 env :
5663 MACOS_EMBEDDED_PROVISION : ${{ secrets.MACOS_EMBEDDED_PROVISION }}
57- - name : Create Runtime Provision Profile
64+ - name : Resolve native macOS signing identities
5865 if : startsWith(github.ref, 'refs/tags/')
5966 run : |
60- echo "$MACOS_RUNTIME_PROVISION" > desktopApp/runtime.provisionprofile.b64
61- base64 -d -i desktopApp/runtime.provisionprofile.b64 > desktopApp/runtime.provisionprofile
67+ set -euo pipefail
68+
69+ security find-identity -v -p codesigning
70+ security find-identity -v -p basic
71+
72+ app_identity=$(security find-identity -v -p codesigning | sed -n 's/.*"\(3rd Party Mac Developer Application: .* (7LFDZ96332)\)".*/\1/p' | head -n 1)
73+ installer_identity=$(security find-identity -v -p basic | sed -n 's/.*"\(3rd Party Mac Developer Installer: .* (7LFDZ96332)\)".*/\1/p' | head -n 1)
74+
75+ if [ -z "$app_identity" ]; then
76+ echo "No 3rd Party Mac Developer Application identity found for team 7LFDZ96332."
77+ exit 1
78+ fi
79+
80+ if [ -z "$installer_identity" ]; then
81+ echo "No 3rd Party Mac Developer Installer identity found for team 7LFDZ96332."
82+ exit 1
83+ fi
84+
85+ echo "NATIVE_MACOS_APP_SIGNING_IDENTITY=$app_identity" >> "$GITHUB_ENV"
86+ echo "NATIVE_MACOS_INSTALLER_SIGNING_IDENTITY=$installer_identity" >> "$GITHUB_ENV"
87+ - name : Add Firebase config
6288 env :
63- MACOS_RUNTIME_PROVISION : ${{ secrets.MACOS_RUNTIME_PROVISION }}
64- # Run tests
65- - name : Run Tests
66- run : ./gradlew jvmTest
67- - name : Build with Gradle
89+ GOOGLE_SERVICE_INFO_PLIST_B64 : ${{ secrets.GOOGLE_SERVICE_INFO_PLIST_B64 }}
90+ run : |
91+ if [ -n "${GOOGLE_SERVICE_INFO_PLIST_B64:-}" ]; then
92+ mkdir -p appleApp/Firebase
93+ printf '%s' "$GOOGLE_SERVICE_INFO_PLIST_B64" | base64 -D > appleApp/Firebase/GoogleService-Info.plist
94+ else
95+ echo "GOOGLE_SERVICE_INFO_PLIST_B64 is not set; Firebase config will not be bundled."
96+ fi
97+ - name : Generate Xcode project
98+ run : xcodegen generate --spec appleApp/project.yml
99+ - name : Resolve native macOS version
100+ run : |
101+ marketing_version="$(sed -n 's/^versionName=//p' fdroid.properties | head -n 1)"
102+
103+ if [[ "$GITHUB_REF_NAME" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
104+ marketing_version="$GITHUB_REF_NAME"
105+ fi
106+
107+ if [ -z "$marketing_version" ]; then
108+ echo "Unable to resolve native macOS marketing version"
109+ exit 1
110+ fi
111+
112+ echo "NATIVE_MACOS_MARKETING_VERSION=$marketing_version" >> "$GITHUB_ENV"
113+ echo "NATIVE_MACOS_BUILD_NUMBER=$GITHUB_RUN_NUMBER" >> "$GITHUB_ENV"
114+ - name : Build native macOS app
115+ if : ${{ ! startsWith(github.ref, 'refs/tags/') }}
116+ working-directory : ./appleApp
68117 env :
69- BUILD_NUMBER : ${{github.run_number}}
70- BUILD_VERSION : ${{github.ref_name}}
71118 SENTRY_DSN : ${{ secrets.SENTRY_DSN }}
72- run : ./gradlew :desktop:check :desktop:build --stacktrace
73- - name : Package with Gradle
119+ run : |
120+ xcodebuild build \
121+ -project Flare.xcodeproj \
122+ -scheme macOS \
123+ -configuration Release \
124+ -destination "generic/platform=macOS" \
125+ -derivedDataPath build/DerivedData \
126+ -skipPackagePluginValidation \
127+ -skipMacroValidation \
128+ GRADLE_JVM_ARGS="-Xmx16G -Dfile.encoding=UTF-8" \
129+ JAVA_OPTS="-Xmx16G" \
130+ MARKETING_VERSION="$NATIVE_MACOS_MARKETING_VERSION" \
131+ CURRENT_PROJECT_VERSION="$NATIVE_MACOS_BUILD_NUMBER" \
132+ CODE_SIGNING_ALLOWED=NO
133+ - name : Archive native macOS app
134+ if : startsWith(github.ref, 'refs/tags/')
135+ working-directory : ./appleApp
74136 env :
75- BUILD_NUMBER : ${{github.run_number}}
76- BUILD_VERSION : ${{github.ref_name}}
137+ FIREBASE_CRASHLYTICS_UPLOAD_SYMBOLS : ${{ startsWith(github.ref, 'refs/tags/') && '1' || '0' }}
77138 SENTRY_DSN : ${{ secrets.SENTRY_DSN }}
78- run : ./gradlew :desktop:packageReleasePkg --stacktrace
79- - name : Archive macOS artifacts Product
139+ run : |
140+ xcodebuild archive \
141+ -project Flare.xcodeproj \
142+ -scheme macOS \
143+ -configuration Release \
144+ -destination "generic/platform=macOS" \
145+ -archivePath "$RUNNER_TEMP/Flare-native-macOS.xcarchive" \
146+ -derivedDataPath build/DerivedData \
147+ -skipPackagePluginValidation \
148+ -skipMacroValidation \
149+ DEVELOPMENT_TEAM=7LFDZ96332 \
150+ CODE_SIGN_STYLE=Manual \
151+ CODE_SIGN_IDENTITY="$NATIVE_MACOS_APP_SIGNING_IDENTITY" \
152+ NATIVE_MACOS_PROVISIONING_PROFILE_SPECIFIER="$NATIVE_MACOS_PROVISIONING_PROFILE_SPECIFIER" \
153+ NATIVE_MACOS_PROVISIONING_PROFILE="$NATIVE_MACOS_PROVISIONING_PROFILE" \
154+ GRADLE_JVM_ARGS="-Xmx16G -Dfile.encoding=UTF-8" \
155+ JAVA_OPTS="-Xmx16G" \
156+ MARKETING_VERSION="$NATIVE_MACOS_MARKETING_VERSION" \
157+ CURRENT_PROJECT_VERSION="$NATIVE_MACOS_BUILD_NUMBER"
158+ - name : Package native macOS app
159+ if : startsWith(github.ref, 'refs/tags/')
160+ run : |
161+ set -euo pipefail
162+
163+ app_path="$RUNNER_TEMP/Flare-native-macOS.xcarchive/Products/Applications/Flare.app"
164+ if [ ! -d "$app_path" ]; then
165+ echo "No archived app found at $app_path"
166+ exit 1
167+ fi
168+
169+ mkdir -p appleApp/build/native-macos/pkg
170+ safe_ref="${GITHUB_REF_NAME//\//-}"
171+ pkg_path="appleApp/build/native-macos/pkg/Flare-native-macOS-$safe_ref.pkg"
172+ productbuild --sign "$NATIVE_MACOS_INSTALLER_SIGNING_IDENTITY" --component "$app_path" /Applications "$pkg_path"
173+ - name : Upload native macOS package
80174 if : startsWith(github.ref, 'refs/tags/')
81175 uses : actions/upload-artifact@v6
82176 with :
83- name : macOS-package
84- path : desktopApp /build/compose/binaries/main-release /pkg/*.pkg
85-
177+ name : Native- macOS-package
178+ path : appleApp /build/native-macos /pkg/*.pkg
179+
86180 build-windows :
87181 runs-on : [windows-latest]
88182 timeout-minutes : 30
97191 env :
98192 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
99193 with :
100- distribution : ' jetbrains'
194+ distribution : " jetbrains"
101195 java-version : 25
102196 # Run tests
103197 - name : Run Tests
@@ -198,7 +292,7 @@ jobs:
198292 env :
199293 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
200294 with :
201- distribution : ' jetbrains'
295+ distribution : " jetbrains"
202296 java-version : 25
203297 # Run tests
204298 - name : Run Tests
0 commit comments