@@ -143,7 +143,7 @@ jobs:
143143 VITE_SENTRY_DSN : ${{ secrets.SENTRY_DSN }}
144144
145145 - name : Import Apple Developer certificate
146- if : ${{ matrix.os == 'macos-latest' && inputs.dry-run == false }}
146+ if : ${{ matrix.os == 'macos-latest' }}
147147 env :
148148 APPLE_CERTIFICATE : ${{ secrets.MACOS_CSC_LINK }}
149149 APPLE_CERTIFICATE_PASSWORD : ${{ secrets.MACOS_CSC_KEY_PASSWORD }}
@@ -159,7 +159,7 @@ jobs:
159159 security find-identity -v -p codesigning build.keychain
160160
161161 - name : Verify Apple certificate
162- if : ${{ matrix.os == 'macos-latest' && inputs.dry-run == false }}
162+ if : ${{ matrix.os == 'macos-latest' }}
163163 run : |
164164 CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "Developer ID Application")
165165 CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}')
@@ -200,10 +200,19 @@ jobs:
200200 SIGN_SCRIPT_PATH="${GITHUB_WORKSPACE}/src-tauri/scripts/sign.ps1"
201201 sed -i.bak "s|\"sign.ps1\"|\"${SIGN_SCRIPT_PATH//\\/\/}\"|g" src-tauri/tauri.conf.json
202202
203+ - name : Prebuild AutoAuth
204+ working-directory : ${{ github.workspace }}
205+ if : ${{ matrix.os == 'windows-latest' }}
206+ run : powershell -ExecutionPolicy Bypass -File ./pre-build-auto-auth.ps1
207+
203208 - name : Code Analysis Core
204209 working-directory : ${{ github.workspace }}/core
205210 run : cargo clippy --all-targets --all-features -- -D warnings
206211
212+ - name : Code Analysis AutoAuth
213+ working-directory : ${{ github.workspace }}/src-auto-auth
214+ run : cargo clippy --all-targets --all-features -- -D warnings
215+
207216 - name : Code Analysis Tauri
208217 working-directory : ${{ github.workspace }}/src-tauri
209218 run : cargo clippy --all-targets --all-features -- -D warnings
@@ -257,6 +266,99 @@ jobs:
257266 args : ${{ secrets.args }}
258267 projectPath : ${{ env.PROJECT_PATH }}
259268
269+ - name : Build & replace custom DMG (macOS)
270+ if : ${{ matrix.os == 'macos-latest' }}
271+ env :
272+ APP_NAME : Decentraland
273+ DMG_BACKGROUND : ${{ github.workspace }}/src-tauri/images/background.png
274+ OUTDIR : src-tauri/target/custom-dmg
275+ CERT_ID : ${{ env.CERT_ID }}
276+ APPLE_ID : ${{ secrets.MACOS_NOTARIZATION_APPLE_ID }}
277+ APPLE_PASSWORD : ${{ secrets.MACOS_NOTARIZATION_PWD }}
278+ APPLE_TEAM_ID : ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}
279+ run : |
280+ set -euo pipefail
281+
282+ # --- Resolve .app bundle path ---
283+ APP_PATH=$(
284+ ls -1d src-tauri/target/release/bundle/macos/${APP_NAME}.app 2>/dev/null || \
285+ ls -1d src-tauri/target/universal-apple-darwin/release/bundle/macos/${APP_NAME}.app 2>/dev/null || \
286+ ls -1d src-tauri/target/aarch64-apple-darwin/release/bundle/macos/${APP_NAME}.app 2>/dev/null || \
287+ ls -1d src-tauri/target/x86_64-apple-darwin/release/bundle/macos/${APP_NAME}.app 2>/dev/null
288+ )
289+ echo "APP_PATH=$APP_PATH" | tee -a "$GITHUB_ENV"
290+ [[ -d "$APP_PATH" ]] || { echo "❌ .app not found"; exit 1; }
291+ [[ -f "$DMG_BACKGROUND" ]] || { echo "⚠️ Missing background: $DMG_BACKGROUND"; }
292+
293+ # --- Ensure shell create-dmg is available ---
294+ brew update
295+ brew install create-dmg
296+
297+ # --- Prepare unique staging folder ---
298+ mkdir -p "$OUTDIR"
299+ TIMESTAMP=$(date +%Y%m%d-%H%M%S)
300+ STAGE="$OUTDIR/dmg-src-$TIMESTAMP"
301+ mkdir -p "$STAGE"
302+ echo "Using staging folder: $STAGE"
303+
304+ # Copy only the .app into the staging folder
305+ cp -R "$APP_PATH" "$STAGE/${APP_NAME}.app"
306+
307+ # --- Build custom DMG ---
308+ DMG_NAME="${APP_NAME}-custom.dmg"
309+ create-dmg \
310+ --volname "Decentraland Installer" \
311+ --background "$DMG_BACKGROUND" \
312+ --window-pos 200 120 \
313+ --window-size 600 520 \
314+ --icon-size 120 \
315+ --icon "${APP_NAME}.app" 300 230 \
316+ --no-internet-enable \
317+ --format ULFO \
318+ "$OUTDIR/$DMG_NAME" \
319+ "$STAGE"
320+
321+ NEW_DMG_PATH="$OUTDIR/$DMG_NAME"
322+ echo "NEW_DMG_PATH=$NEW_DMG_PATH" | tee -a "$GITHUB_ENV"
323+ [[ -f "$NEW_DMG_PATH" ]] || { echo "❌ Custom DMG not created"; exit 1; }
324+
325+ # --- Codesign + verify ---
326+ codesign --force --sign "$CERT_ID" --timestamp "$NEW_DMG_PATH"
327+ codesign --verify --verbose "$NEW_DMG_PATH"
328+
329+ # --- Notarize + staple ---
330+ xcrun notarytool submit "$NEW_DMG_PATH" \
331+ --apple-id "$APPLE_ID" \
332+ --team-id "$APPLE_TEAM_ID" \
333+ --password "$APPLE_PASSWORD" \
334+ --wait
335+ xcrun stapler staple "$NEW_DMG_PATH"
336+
337+ # --- Replace Tauri DMG with same original filename ---
338+ DMG_DIR=$(
339+ ls -1d src-tauri/target/release/bundle/dmg 2>/dev/null || \
340+ ls -1d src-tauri/target/universal-apple-darwin/release/bundle/dmg 2>/dev/null || \
341+ ls -1d src-tauri/target/aarch64-apple-darwin/release/bundle/dmg 2>/dev/null || \
342+ ls -1d src-tauri/target/x86_64-apple-darwin/release/bundle/dmg 2>/dev/null
343+ )
344+ if [[ ! -d "$DMG_DIR" ]]; then
345+ echo "⚠️ Tauri DMG dir not found; leaving custom DMG at $NEW_DMG_PATH"
346+ exit 1
347+ fi
348+
349+ ORIG_DMG=$(ls -1 "$DMG_DIR"/*.dmg 2>/dev/null | head -n1 || true)
350+ if [[ -z "${ORIG_DMG}" ]]; then
351+ echo "❌ No existing Tauri DMG found in $DMG_DIR to infer original name"; exit 1
352+ fi
353+ ORIG_NAME="$(basename "$ORIG_DMG")"
354+
355+ rm -f "$DMG_DIR"/*.dmg
356+ FINAL_DMG="$DMG_DIR/$ORIG_NAME"
357+ cp "$NEW_DMG_PATH" "$FINAL_DMG"
358+
359+ echo "FINAL_DMG=$FINAL_DMG" | tee -a "$GITHUB_ENV"
360+ echo "✅ Replaced Tauri DMG with custom DMG at $FINAL_DMG (kept original filename)"
361+
260362 - name : Verify Windows signature
261363 if : ${{ matrix.os == 'windows-latest' && inputs.dry-run == false }}
262364 run : |
0 commit comments