Compare commits

...
Author SHA1 Message Date
feder-cr 316f072dfc ci(release-test): full 5-target release pipeline (draft) for end-to-end test 2026-06-08 22:20:49 +02:00
feder-cr f234855bcd ci(render): final Linux validation no-mold — x64+arm64 build + --version gate + real render via xvfb/llvmpipe 2026-06-08 19:59:07 +02:00
feder-cr d30f77d7a8 ci(macos): add in-job RUNTIME TEST (--version + headless screenshot) on the Mac runner + upload shot 2026-06-08 18:25:41 +02:00
feder-cr 078deeca74 ci(trial): macOS native build legs (macos-15 arm64 + macos-15-intel) — xcode-select 26.2 + --with-macos-sdk + ad-hoc codesign 2026-06-08 12:05:07 +02:00
feder-cr 8832ccb3b4 ci(probe): macOS native-runner SDK 26.2 + NSGlassEffectView + ad-hoc codesign gate 2026-06-08 12:01:01 +02:00
feder-cr 90b2bc15d4 ci(trial) v7: cross-compile the other 4 targets (linux-x64, win-x64, macos-arm64, macos-x64) from Linux — camoufox recipe (--target + rustup + --enable-bootstrap auto-fetches toolchains), per-leg heartbeat branches 2026-06-08 09:31:32 +02:00
feder-cr ddd8750c3d ci(trial) v6: drop sccache (broke configure) + bogus bootstrap step; keep --disable-debug-symbols + mold to test cold-build fit 2026-06-08 08:17:27 +02:00
feder-cr d75e00649d ci(trial) v5: extend repo .mozconfig (one file) — fixes the 'multiple default mozconfig' stall 2026-06-08 08:06:53 +02:00
feder-cr a34950602b ci(trial) v4: single clean leg + PTY live log + objdir-size heartbeat (proper visibility) 2026-06-08 07:21:56 +02:00
feder-cr 24c6538d9b ci(trial) v3: speed levers (debug-symbols off, mold, sccache C++, swap) + live heartbeat (no tail) 2026-06-08 06:02:01 +02:00
feder-cr a369fb157b ci(trial): fix bootstrap hang — --no-interactive after subcommand + </dev/null + timeout 2026-06-07 23:32:09 +02:00
feder-cr 88ebf1f1a1 ci(trial): feasibility build of linux-arm64 (native) + macos-arm64 (cross) on free runners
Throwaway trial to de-risk the all-in-CI firefox-N pipeline before writing it.
linux-arm64 = issue #6 (cloudeyes) + proves our tree builds in free CI.
macos-arm64 = R1 cross-compile check. No upload/sign/release touched.
2026-06-07 22:36:16 +02:00
5 changed files with 720 additions and 0 deletions

No files matched your search

+156
View File
@@ -0,0 +1,156 @@
# TRIAL v7 — the OTHER 4 targets, after v6 proved linux-arm64-native (cold build
# 58m, binary produced). Cross-compile recipe taken from camoufox's CI (read its
# Makefile/patch.py): the ONLY cross config needed is `ac_add_options --target=<triple>`
# + `rustup target add <triple>`; --enable-bootstrap (already in our .mozconfig)
# auto-fetches every cross toolchain via fetch-content — clang-cl+VS for Windows,
# the redistributable macOS SDK + cctools/ld64 for Darwin. No proprietary SDK to
# procure. mold only on Linux (Win uses lld-link, macOS uses ld64). The Win leg
# also re-adds the --disable-*{maintenance-service,update-agent,default-browser-agent}
# flags because our .mozconfig gates them on the HOST uname (wrong for cross).
# Each leg streams a live PTY log + objdir-size heartbeat to its own
# ci-progress-<leg> branch so 4 concurrent legs don't clobber each other.
name: crossbuild-trial
on:
push:
branches: [ci-crossbuild-trial]
workflow_dispatch:
permissions:
contents: write
jobs:
trial:
name: ${{ matrix.leg }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 350
strategy:
fail-fast: false
matrix:
include:
- leg: linux-x86_64
runner: ubuntu-24.04
triple: x86_64-pc-linux-gnu
rust_target: x86_64-unknown-linux-gnu
use_mold: "yes"
win_disables: "no"
extra_pkgs: "mold"
bin: firefox
- leg: win-x86_64
runner: ubuntu-24.04
triple: x86_64-pc-windows-msvc
rust_target: x86_64-pc-windows-msvc
use_mold: "no"
win_disables: "yes"
extra_pkgs: "msitools p7zip-full"
bin: firefox.exe
- leg: macos-arm64
runner: ubuntu-24.04
triple: aarch64-apple-darwin
rust_target: aarch64-apple-darwin
use_mold: "no"
win_disables: "no"
extra_pkgs: ""
bin: firefox
- leg: macos-x86_64
runner: ubuntu-24.04
triple: x86_64-apple-darwin
rust_target: x86_64-apple-darwin
use_mold: "no"
win_disables: "no"
extra_pkgs: ""
bin: firefox
steps:
- name: Free disk + 16G swap
run: |
df -h /
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android \
/usr/local/share/boost "${AGENT_TOOLSDIRECTORY:-/opt/hostedtoolcache}" 2>/dev/null || true
sudo apt-get clean 2>/dev/null || true
sudo fallocate -l 16G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile || true
echo "--- after ---"; df -h /; free -h
- name: Checkout patched Firefox source (shallow)
uses: actions/checkout@v4
with:
repository: feder-cr/invisible_firefox
ref: stealth/150
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build tools (util-linux for PTY + per-leg extras)
run: |
sudo apt-get update
sudo apt-get install -y util-linux ${{ matrix.extra_pkgs }}
- name: Add Rust target for cross
run: rustup target add ${{ matrix.rust_target }} || true
- name: Extend the repo's .mozconfig with target + cold-build levers (ONE mozconfig)
run: |
test -f .mozconfig || { echo "ERROR: no .mozconfig in source tree"; exit 1; }
rm -f mozconfig # never a second default mozconfig
{
echo ""
echo "# --- trial CI cross levers appended for ${{ matrix.leg }} ---"
echo "ac_add_options --disable-debug-symbols"
echo "ac_add_options --target=${{ matrix.triple }}"
} >> .mozconfig
if [ "${{ matrix.use_mold }}" = "yes" ]; then
echo "ac_add_options --enable-linker=mold" >> .mozconfig
fi
if [ "${{ matrix.win_disables }}" = "yes" ]; then
{
echo "ac_add_options --disable-default-browser-agent"
echo "ac_add_options --disable-maintenance-service"
echo "ac_add_options --disable-update-agent"
} >> .mozconfig
fi
{
echo "mk_add_options MOZ_PARALLEL_BUILD=4"
echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-trial"
} >> .mozconfig
echo "----- final .mozconfig -----"; cat .mozconfig
- name: BUILD under PTY (live log) + heartbeat with objdir-size signal
id: build
env:
GH_PUSH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set +e
LEG="${{ matrix.leg }}"
HBRANCH="ci-progress-${LEG}"
git clone --depth 1 "https://x-access-token:${GH_PUSH_TOKEN}@github.com/feder-cr/invisible_playwright" hb 2>/dev/null
( cd hb && git checkout -B "$HBRANCH" && git config user.email ci@local && git config user.name ci-bot ) 2>/dev/null
# PTY -> unbuffered live log. --enable-bootstrap (in .mozconfig) fetches cross toolchains during configure.
( script -qefc './mach build' build.log >/dev/null 2>&1 ; echo $? > build.rc ) &
BPID=$!
START=$(date +%s)
push_progress() {
{
echo "leg=${LEG} elapsed=$1 m ($(date -u +%H:%M:%S) UTC) state=$2"
echo "objdir=$(du -sh obj-trial 2>/dev/null | cut -f1) rootfree=$(df -h / | awk 'NR==2{print $4}')"
echo '---- build.log tail (live, PTY) ----'
tail -25 build.log 2>/dev/null
} > hb/progress.txt
( cd hb && git add -A && (git commit -q --amend --no-edit 2>/dev/null || git commit -q -m p 2>/dev/null); git push -f -q origin "$HBRANCH" ) 2>/dev/null || true
}
while kill -0 "$BPID" 2>/dev/null; do
EL=$(( ($(date +%s) - START) / 60 )); push_progress "$EL" "building"; sleep 120
done
wait "$BPID"; RC=$(cat build.rc 2>/dev/null || echo 1)
EL=$(( ($(date +%s) - START) / 60 )); push_progress "$EL" "DONE rc=$RC"
echo "=== BUILD exit=$RC after ${EL}m ==="
echo "=== build.log tail (last 200) ==="; tail -200 build.log 2>/dev/null
[ "$RC" = "0" ] && echo "finished=true" >> "$GITHUB_OUTPUT" || echo "finished=false" >> "$GITHUB_OUTPUT"
- name: Report result
run: |
echo "leg=${{ matrix.leg }} finished=${{ steps.build.outputs.finished }}"
du -sh obj-trial 2>/dev/null || true
ls -la obj-trial/dist/bin/${{ matrix.bin }} 2>/dev/null && echo "BINARY PRODUCED (${{ matrix.bin }})" || echo "no binary"
echo "--- dist/bin listing ---"; ls -la obj-trial/dist/bin/ 2>/dev/null | head -40 || true
+87
View File
@@ -0,0 +1,87 @@
# FINAL Linux validation with the FIX (no mold): build linux-x64 + linux-arm64 with
# the clean recipe (--disable-debug-symbols only, NO mold, NO --target) and RUNTIME
# TEST in-job on the native runner: firefox --version (hard gate) + a REAL render via
# xvfb + mesa software GL (llvmpipe) so we get an actual screenshot on Linux too,
# not just --version. Proves both Linux arches run AND render with mold dropped.
name: linux-render
on:
push:
branches: [ci-linux-render]
workflow_dispatch:
permissions:
contents: write
jobs:
render:
name: ${{ matrix.leg }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 220
strategy:
fail-fast: false
matrix:
include:
- leg: linux-x86_64
runner: ubuntu-24.04
- leg: linux-arm64
runner: ubuntu-24.04-arm
steps:
- name: Free disk + 16G swap
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android \
/usr/local/share/boost "${AGENT_TOOLSDIRECTORY:-/opt/hostedtoolcache}" 2>/dev/null || true
sudo fallocate -l 16G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile || true
- name: Checkout patched Firefox source (shallow)
uses: actions/checkout@v4
with: { repository: feder-cr/invisible_firefox, ref: stealth/150, fetch-depth: 1 }
- name: Set up Python
uses: actions/setup-python@v5
with: { python-version: '3.11' }
- name: Install xvfb + mesa software GL (for a real headless render)
run: |
sudo apt-get update
sudo apt-get install -y xvfb libgl1-mesa-dri libglu1-mesa mesa-utils libegl1 libgbm1
- name: Extend .mozconfig (NO mold, NO --target — the FIX)
run: |
test -f .mozconfig || { echo "no .mozconfig"; exit 1; }
rm -f mozconfig
{ echo ""; echo "# linux-render (mold dropped)"; echo "ac_add_options --disable-debug-symbols";
echo "mk_add_options MOZ_PARALLEL_BUILD=4"; echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-trial"; } >> .mozconfig
cat .mozconfig
- name: Build
id: build
run: |
set +e
./mach build > build.log 2>&1; RC=$?
echo "build_rc=$RC"; tail -30 build.log
[ "$RC" = "0" ] && echo "ok=true" >> "$GITHUB_OUTPUT" || echo "ok=false" >> "$GITHUB_OUTPUT"
- name: RUNTIME TEST (--version gate + real render via mesa)
if: steps.build.outputs.ok == 'true'
run: |
set +e
BIN=obj-trial/dist/bin
echo "=== --version (HARD GATE) ==="
LD_LIBRARY_PATH=$BIN $BIN/firefox-bin --version; echo "VERSION_RC=$?"
echo "=== real headless render via xvfb + llvmpipe ==="
export LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=llvmpipe MOZ_WEBRENDER=1
rm -f shot.png
xvfb-run -a -s "-screen 0 1366x768x24" timeout 120 \
$BIN/firefox --headless --no-remote --profile ./prof --screenshot "$PWD/shot.png" "https://example.com" > ss.log 2>&1
echo "screenshot_cmd_rc=$?"; tail -10 ss.log
if [ -f shot.png ]; then echo "SCREENSHOT_RESULT=OK bytes=$(stat -c%s shot.png)"; cp shot.png "render-${{ matrix.leg }}.png"; else echo "SCREENSHOT_RESULT=FAIL"; fi
- name: Upload render
if: steps.build.outputs.ok == 'true'
uses: actions/upload-artifact@v4
with:
name: render-${{ matrix.leg }}
path: render-${{ matrix.leg }}.png
if-no-files-found: ignore
retention-days: 5
+161
View File
@@ -0,0 +1,161 @@
# TRIAL — the 2 macOS legs, native runners (probe confirmed: macos-15 + macos-15-intel
# both ship Xcode 26.2 / SDK macosx26.2, NSGlassEffectView present, ad-hoc codesign OK).
# This proves OUR patched tree actually compiles + packages + ad-hoc-signs end-to-end,
# not just that the SDK exists. Recipe: xcode-select 26.2, pass --with-macos-sdk (this
# alone disables the 403'd tooltool SDK fetch — verified in toolchain.configure: the
# bootstrapped SDK fetch is gated `when not --with-macos-sdk`), keep the repo's
# --enable-bootstrap (fetches Mozilla clang; SDK fetch already disabled), --target +
# rustup target. NO mold (macOS uses ld64). Live PTY log + per-leg ci-progress heartbeat.
name: macos-build-trial
on:
push:
branches: [ci-macos-build]
workflow_dispatch:
permissions:
contents: write
jobs:
trial:
name: ${{ matrix.leg }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 350
strategy:
fail-fast: false
matrix:
include:
- leg: macos-arm64
runner: macos-15
triple: aarch64-apple-darwin
rust_target: aarch64-apple-darwin
bin: firefox
- leg: macos-x86_64
runner: macos-15-intel
triple: x86_64-apple-darwin
rust_target: x86_64-apple-darwin
bin: firefox
steps:
- name: Checkout patched Firefox source (shallow)
uses: actions/checkout@v4
with:
repository: feder-cr/invisible_firefox
ref: stealth/150
fetch-depth: 1
- name: Select Xcode 26.2 + export SDK path
run: |
sudo xcode-select -s /Applications/Xcode_26.2.app
SDKP="$(xcrun --show-sdk-path)"
echo "SDK_PATH=$SDKP" >> "$GITHUB_ENV"
echo "selected SDK $(xcrun --sdk macosx --show-sdk-version) at $SDKP"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Add Rust target
run: |
if ! command -v rustup >/dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
fi
rustup target add ${{ matrix.rust_target }}
- name: Extend the repo's .mozconfig (target + SDK + cold levers, ONE mozconfig)
run: |
test -f .mozconfig || { echo "ERROR: no .mozconfig in source tree"; exit 1; }
rm -f mozconfig
{
echo ""
echo "# --- macOS trial levers for ${{ matrix.leg }} ---"
echo "ac_add_options --disable-debug-symbols"
echo "ac_add_options --target=${{ matrix.triple }}"
echo "ac_add_options --with-macos-sdk=$SDK_PATH"
echo "mk_add_options MOZ_PARALLEL_BUILD=$(sysctl -n hw.ncpu)"
echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-trial"
} >> .mozconfig
echo "----- final .mozconfig -----"; cat .mozconfig
- name: BUILD under PTY (live log) + heartbeat with objdir-size signal
id: build
env:
GH_PUSH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set +e
LEG="${{ matrix.leg }}"
HBRANCH="ci-progress-${LEG}"
git clone --depth 1 "https://x-access-token:${GH_PUSH_TOKEN}@github.com/feder-cr/invisible_playwright" hb 2>/dev/null
( cd hb && git checkout -B "$HBRANCH" && git config user.email ci@local && git config user.name ci-bot ) 2>/dev/null
# BSD `script` (macOS): script -q <file> <command...> (different syntax from util-linux)
( script -q build.log ./mach build >/dev/null 2>&1 ; echo $? > build.rc ) &
BPID=$!
START=$(date +%s)
push_progress() {
{
echo "leg=${LEG} elapsed=$1 m ($(date -u +%H:%M:%S) UTC) state=$2"
echo "objdir=$(du -sh obj-trial 2>/dev/null | cut -f1) rootfree=$(df -h / | awk 'NR==2{print $4}')"
echo '---- build.log tail (live, PTY) ----'
tail -25 build.log 2>/dev/null
} > hb/progress.txt
( cd hb && git add -A && (git commit -q --amend --no-edit 2>/dev/null || git commit -q -m p 2>/dev/null); git push -f -q origin "$HBRANCH" ) 2>/dev/null || true
}
while kill -0 "$BPID" 2>/dev/null; do
EL=$(( ($(date +%s) - START) / 60 )); push_progress "$EL" "building"; sleep 120
done
wait "$BPID"; RC=$(cat build.rc 2>/dev/null || echo 1)
EL=$(( ($(date +%s) - START) / 60 )); push_progress "$EL" "DONE rc=$RC"
echo "=== BUILD exit=$RC after ${EL}m ==="
echo "=== build.log tail (last 200) ==="; tail -200 build.log 2>/dev/null
[ "$RC" = "0" ] && echo "finished=true" >> "$GITHUB_OUTPUT" || echo "finished=false" >> "$GITHUB_OUTPUT"
- name: Package + ad-hoc codesign (no paid cert)
if: steps.build.outputs.finished == 'true'
run: |
set +e
./mach package
echo "package rc=$?"
APP="$(find obj-trial -maxdepth 6 -name 'Firefox*.app' -o -maxdepth 6 -name '*.app' -type d 2>/dev/null | head -1)"
echo "APP=$APP"
if [ -n "$APP" ]; then
codesign --force --deep --sign - --timestamp=none "$APP"
codesign --verify --deep --strict --verbose=2 "$APP" && echo "CODESIGN ADHOC OK"
xattr -dr com.apple.quarantine "$APP" || true
fi
- name: RUNTIME TEST on the Mac runner (the whole point)
if: steps.build.outputs.finished == 'true'
run: |
set +e
APP="$(find obj-trial -maxdepth 6 -name '*.app' -type d 2>/dev/null | head -1)"
FFBIN="$APP/Contents/MacOS/firefox"
echo "FFBIN=$FFBIN"
echo "=== --version ==="
"$FFBIN" --version; echo "VERSION_RC=$?"
echo "=== headless screenshot of a real page ==="
rm -f "$PWD/shot.png"
"$FFBIN" --headless --no-remote --profile "$PWD/macprof" --screenshot "$PWD/shot.png" "https://example.com" > ss.log 2>&1 &
SPID=$!
for i in $(seq 1 110); do kill -0 $SPID 2>/dev/null || break; sleep 1; done
kill -9 $SPID 2>/dev/null
echo "--- ss.log tail ---"; tail -8 ss.log
if [ -f "$PWD/shot.png" ]; then echo "SCREENSHOT_RESULT=OK bytes=$(stat -f%z "$PWD/shot.png")"; cp "$PWD/shot.png" "macshot-${{ matrix.leg }}.png"; else echo "SCREENSHOT_RESULT=FAIL"; fi
- name: Upload mac screenshot
if: steps.build.outputs.finished == 'true'
uses: actions/upload-artifact@v4
with:
name: macshot-${{ matrix.leg }}
path: macshot-${{ matrix.leg }}.png
if-no-files-found: ignore
retention-days: 5
- name: Report result
run: |
echo "leg=${{ matrix.leg }} finished=${{ steps.build.outputs.finished }}"
du -sh obj-trial 2>/dev/null || true
ls -la obj-trial/dist/bin/${{ matrix.bin }} 2>/dev/null && echo "BINARY PRODUCED (${{ matrix.bin }})" || echo "no binary"
echo "--- .app + dmg ---"
find obj-trial -maxdepth 6 -name '*.app' -type d 2>/dev/null | head
ls -la obj-trial/dist/*.dmg 2>/dev/null || true
+63
View File
@@ -0,0 +1,63 @@
# PROBE (cheap, ~2-5 min, $0) — gate before wiring the real macOS build legs.
# FF150 hard-requires macOS SDK >= 26.2 (toolchain.configure mac_sdk_min_version),
# and cross-from-Linux 403'd fetching the Apple SDK. The research recommendation is
# NATIVE macОС runners (macos-15 / macos-15-intel) whose preinstalled Xcode 26.2
# ships SDK macosx26.2. This probe empirically confirms, per runner label:
# - Xcode 26.2 is present + selectable, selected SDK >= 26.2
# - the decisive compile-time gate: NSGlassEffectView header exists in the SDK
# - rust apple-darwin targets installable
# - ad-hoc codesign (no paid cert) works
# Asserts (exit 1) on any failure so a red job == "this label won't work".
name: macos-probe
on:
push:
branches: [ci-macos-probe]
workflow_dispatch:
jobs:
probe:
name: probe-${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [macos-15, macos-15-intel]
steps:
- name: Probe SDK + toolchain + codesign
run: |
set -e
echo "== runner =="; uname -m; sw_vers || true; sysctl -n hw.ncpu; sysctl -n hw.memsize
echo "== xcodes present =="; ls /Applications | grep -i xcode || true
if [ -d /Applications/Xcode_26.2.app ]; then
sudo xcode-select -s /Applications/Xcode_26.2.app
echo "selected Xcode_26.2.app"
else
echo "WARN: /Applications/Xcode_26.2.app NOT found — using default $(xcode-select -p)"
fi
echo "== showsdks (macos) =="; xcodebuild -showsdks 2>/dev/null | grep -i macos || true
SDKV="$(xcrun --sdk macosx --show-sdk-version)"
SDKP="$(xcrun --show-sdk-path)"
echo "selected SDK version: $SDKV"
echo "selected SDK path: $SDKP"
MIN=26.2
LOWEST="$(printf '%s\n%s\n' "$MIN" "$SDKV" | sort -V | head -1)"
if [ "$LOWEST" = "$MIN" ]; then echo "ASSERT SDK OK (>= $MIN)"; else echo "ASSERT FAIL: SDK $SDKV < $MIN"; exit 1; fi
echo "== NSGlassEffectView header (decisive compile gate) =="
if grep -rl NSGlassEffectView "$SDKP/System/Library/Frameworks/AppKit.framework/" >/dev/null 2>&1; then
echo "ASSERT NSGlassEffectView: PRESENT"
else
echo "ASSERT FAIL: NSGlassEffectView MISSING -> SDK too old for FF150"; exit 1
fi
echo "== rust + apple-darwin targets =="
if ! command -v rustup >/dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
fi
rustup target add aarch64-apple-darwin x86_64-apple-darwin && echo "ASSERT rust-targets OK"
echo "== ad-hoc codesign (no paid cert) =="
printf 'int main(){return 0;}' > t.c && cc t.c -o t
codesign --force --sign - --timestamp=none t
codesign --verify --strict --verbose=2 t && echo "ASSERT codesign-adhoc OK"
echo "PROBE_DONE leg=${{ matrix.os }} arch=$(uname -m) sdk=$SDKV cores=$(sysctl -n hw.ncpu)"
+253
View File
@@ -0,0 +1,253 @@
# ─────────────────────────────────────────────────────────────────────────────
# release.yml — build all 5 patched-Firefox targets at $0 on GitHub Actions and
# publish them as DRAFT GitHub Release assets, named per the wrapper contract
# (constants.ARCHIVE_NAME). DRAFT on purpose: a human runs the realness gate
# (validate_release.py + real-site checks) and only THEN un-drafts + bumps
# BINARY_VERSION. Nothing auto-ships (issue #14 lesson).
#
# Architecture (hybrid, all free runners):
# linux-x64 / linux-arm64 → native Linux runners (lld, NEVER mold — mold segfaults)
# win-x64 → CROSS from Linux (clang-cl+VS via --enable-bootstrap)
# macos-arm64 / macos-x64 → native macOS runners (Xcode 26.2 SDK + ad-hoc codesign)
#
# Trigger: push a tag `firefox-N` (the release tag), or run manually.
# ─────────────────────────────────────────────────────────────────────────────
name: release
on:
push:
tags: ['firefox-*']
workflow_dispatch:
inputs:
source_ref:
description: 'invisible_firefox ref to build'
default: 'stealth/150'
release_tag:
description: 'release tag to publish the draft under (e.g. firefox-9)'
required: true
env:
SOURCE_REPO: feder-cr/invisible_firefox
SOURCE_REF: ${{ github.event.inputs.source_ref || 'stealth/150' }}
# Must match constants.BINARY_BASENAME in the wrapper.
BASENAME: firefox-150.0.1-stealth
jobs:
build:
name: build-${{ matrix.leg }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 350
strategy:
fail-fast: false
matrix:
include:
- leg: linux-x86_64
runner: ubuntu-24.04
family: linux
target: ''
rust_target: x86_64-unknown-linux-gnu
win_disables: 'no'
extra_pkgs: ''
asset: firefox-150.0.1-stealth-linux-x86_64.tar.gz
- leg: linux-arm64
runner: ubuntu-24.04-arm
family: linux
target: ''
rust_target: aarch64-unknown-linux-gnu
win_disables: 'no'
extra_pkgs: ''
asset: firefox-150.0.1-stealth-linux-arm64.tar.gz
- leg: win-x86_64
runner: ubuntu-24.04
family: win # built ON linux (cross), packaged as .zip
target: x86_64-pc-windows-msvc
rust_target: x86_64-pc-windows-msvc
win_disables: 'yes'
extra_pkgs: 'msitools p7zip-full zip'
asset: firefox-150.0.1-stealth-win-x86_64.zip
- leg: macos-arm64
runner: macos-15
family: mac
target: aarch64-apple-darwin
rust_target: aarch64-apple-darwin
win_disables: 'no'
extra_pkgs: ''
asset: firefox-150.0.1-stealth-macos-arm64.tar.gz
- leg: macos-x86_64
runner: macos-15-intel
family: mac
target: x86_64-apple-darwin
rust_target: x86_64-apple-darwin
win_disables: 'no'
extra_pkgs: ''
asset: firefox-150.0.1-stealth-macos-x86_64.tar.gz
steps:
- name: Free disk + 16G swap (Linux runners)
if: matrix.family != 'mac'
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android \
/usr/local/share/boost "${AGENT_TOOLSDIRECTORY:-/opt/hostedtoolcache}" 2>/dev/null || true
sudo fallocate -l 16G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile || true
- name: Checkout patched Firefox source
uses: actions/checkout@v4
with:
repository: ${{ env.SOURCE_REPO }}
ref: ${{ env.SOURCE_REF }}
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v5
with: { python-version: '3.11' }
- name: Install Linux build tools
if: matrix.family != 'mac'
run: |
sudo apt-get update
sudo apt-get install -y util-linux ${{ matrix.extra_pkgs }}
- name: Select Xcode 26.2 + export SDK path (macOS)
if: matrix.family == 'mac'
run: |
sudo xcode-select -s /Applications/Xcode_26.2.app
SDKP="$(xcrun --show-sdk-path)"
echo "SDK_PATH=$SDKP" >> "$GITHUB_ENV"
echo "macOS SDK $(xcrun --sdk macosx --show-sdk-version) at $SDKP"
- name: Add Rust target
run: rustup target add ${{ matrix.rust_target }} || true
- name: Extend the repo .mozconfig (NO mold; +target/SDK as needed)
run: |
test -f .mozconfig || { echo "ERROR: no .mozconfig in source"; exit 1; }
rm -f mozconfig
{
echo ""
echo "# --- release CI levers for ${{ matrix.leg }} (mold intentionally OFF) ---"
echo "ac_add_options --disable-debug-symbols"
} >> .mozconfig
if [ -n "${{ matrix.target }}" ]; then echo "ac_add_options --target=${{ matrix.target }}" >> .mozconfig; fi
if [ "${{ matrix.family }}" = "mac" ]; then echo "ac_add_options --with-macos-sdk=$SDK_PATH" >> .mozconfig; fi
if [ "${{ matrix.win_disables }}" = "yes" ]; then
{ echo "ac_add_options --disable-default-browser-agent";
echo "ac_add_options --disable-maintenance-service";
echo "ac_add_options --disable-update-agent"; } >> .mozconfig
fi
if [ "${{ matrix.family }}" = "mac" ]; then NCPU=$(sysctl -n hw.ncpu); else NCPU=4; fi
{ echo "mk_add_options MOZ_PARALLEL_BUILD=$NCPU";
echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-rel"; } >> .mozconfig
echo "----- final .mozconfig -----"; cat .mozconfig
- name: Build
run: ./mach build
- name: Package + runtime smoke (linux/mac self-gate; win packaged only)
id: pkg
run: |
set -e
mkdir -p out
if [ "${{ matrix.family }}" = "linux" ]; then
BIN=obj-rel/dist/bin
echo "=== --version GATE ==="
LD_LIBRARY_PATH=$BIN $BIN/firefox-bin --version # fails the job if it segfaults
tar -czf "out/${{ matrix.asset }}" -C "$BIN" .
elif [ "${{ matrix.family }}" = "win" ]; then
# cross-built on Linux: cannot exec the PE here → gated by the gate-windows job
BIN=obj-rel/dist/bin
( cd "$BIN" && zip -qr "$GITHUB_WORKSPACE/out/${{ matrix.asset }}" . )
else # mac
./mach package
APP="$(find obj-rel/dist -maxdepth 2 -name '*.app' -type d | head -1)"
echo "built app: $APP"
codesign --force --deep --sign - --timestamp=none "$APP"
codesign --verify --deep --strict --verbose=2 "$APP"
echo "=== --version GATE ==="
"$APP/Contents/MacOS/firefox" --version # fails the job if it segfaults
# rename to a stable bundle dir name for the wrapper entry path
STABLE="$(dirname "$APP")/Firefox.app"
[ "$APP" = "$STABLE" ] || mv "$APP" "$STABLE"
tar -czf "out/${{ matrix.asset }}" -C "$(dirname "$STABLE")" "Firefox.app"
fi
echo "asset=${{ matrix.asset }}" >> "$GITHUB_OUTPUT"
ls -la out/
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: asset-${{ matrix.leg }}
path: out/${{ matrix.asset }}
if-no-files-found: error
retention-days: 7
# Windows binary is cross-built on Linux, so gate it on a real Windows runner.
gate-windows:
name: gate-windows
needs: build
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: Download win asset
uses: actions/download-artifact@v4
with: { name: asset-win-x86_64, path: art }
- name: Extract + headless screenshot gate
shell: pwsh
run: |
$zip = Get-ChildItem art -Filter *.zip | Select-Object -First 1
Expand-Archive $zip.FullName -DestinationPath ff -Force
$exe = Join-Path (Resolve-Path ff) 'firefox.exe'
Remove-Item shot.png -ErrorAction SilentlyContinue
$p = Start-Process -FilePath $exe -ArgumentList '--headless','--no-remote','--profile','prof','--screenshot',"$PWD\shot.png",'https://example.com' -PassThru -NoNewWindow
if (-not $p.WaitForExit(90000)) { $p.Kill(); throw 'win gate TIMEOUT' }
Start-Sleep 1
if (-not (Test-Path shot.png) -or (Get-Item shot.png).Length -lt 3000) { throw 'win gate: no/empty screenshot' }
Write-Output "win gate OK: shot.png $((Get-Item shot.png).Length) bytes"
- uses: actions/upload-artifact@v4
with: { name: gate-win-screenshot, path: shot.png, if-no-files-found: warn, retention-days: 7 }
publish:
name: publish-draft-release
needs: [build, gate-windows]
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Download all build assets
uses: actions/download-artifact@v4
with:
pattern: asset-*
path: dl
merge-multiple: true
- name: Generate checksums.txt
run: |
cd dl
ls -la
sha256sum * > checksums.txt
echo "----- checksums.txt -----"; cat checksums.txt
- name: Resolve release tag
id: tag
run: |
TAG="${{ github.event.inputs.release_tag }}"
[ -z "$TAG" ] && TAG="${GITHUB_REF_NAME}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "publishing DRAFT release for tag: $TAG"
- name: Create DRAFT release with all assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: invisible_firefox (150.0.1) rev ${{ steps.tag.outputs.tag }}
draft: true # human un-drafts after the realness gate
prerelease: false
files: |
dl/*.tar.gz
dl/*.zip
dl/checksums.txt
body: |
Patched Firefox 150.0.1 — built on GitHub Actions ($0, no mold).
Targets: linux-x86_64, linux-arm64, win-x86_64, macos-arm64, macos-x86_64.
DRAFT — do not publish until validate_release.py + realness gate pass on all archives.
macOS: ad-hoc signed (not notarized). After download run:
xattr -dr com.apple.quarantine Firefox.app
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}