diff --git a/.github/workflows/build-remote-server.yml b/.github/workflows/build-remote-server.yml new file mode 100644 index 0000000000..367cf827de --- /dev/null +++ b/.github/workflows/build-remote-server.yml @@ -0,0 +1,92 @@ +# Build-remote-server — baut NUR das Linux-remote-server-Binary (statisch musl), +# das auf dem SSH-Ziel-Host (z.B. devhost) als Daemon läuft. +# +# Hintergrund: zaplex ist eine macOS-App, aber die persistente Remote-Session +# läuft als Daemon auf dem Linux-Ziel-Host. Der Client (DMG) erwartet das Binary +# unter ~/.zap/remote-server/zap-oss-. Im Fork-Setup schlägt der +# Auto-Download (zerx-lab/warp releases) fehl, daher wird dieses Binary als +# Artefakt gebaut und manuell auf den Ziel-Host gelegt (check_binary besteht dann, +# der Download-Pfad wird nie genommen). +# +# Aufruf: gh workflow run build-remote-server.yml -R byte5ai/zaplex --ref \ +# [-f dmg_tag=v0.daemontest] +# Danach: gh run download -R byte5ai/zaplex -n zap-remote-server-linux-x86_64 +# → Binary nach ~/.zap/remote-server/zap-oss- auf dem Ziel-Host, +# chmod 755. (muss zum dmg_tag des getesteten DMG passen.) +# +# Statischer musl-Build (zigbuild) → läuft auf jedem Linux x86_64 unabhängig von +# der glibc-Version des Hosts. Spiegelt den CLI-Build aus zap_release.yml. + +name: Build remote-server (Linux) + +on: + workflow_dispatch: + inputs: + dmg_tag: + description: "GIT_RELEASE_TAG — muss zum getesteten DMG passen (kosmetisch für die Binary-Version)" + type: string + default: v0.daemontest + +env: + CARGO_TERM_COLOR: always + CHANNEL: oss + +jobs: + build_remote_server: + name: Build Linux remote-server (musl x86_64) + runs-on: ubuntu-22.04 + timeout-minutes: 180 + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Free up disk space + shell: bash + run: | + sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc \ + /usr/local/.ghcup /opt/hostedtoolcache/CodeQL /usr/share/swift || true + df -h / + + - uses: ./.github/actions/prepare_environment + with: + target_os: linux + is_self_hosted: false + install_release_deps: true + + - name: Install zig + cargo-zigbuild for static musl build + run: | + set -euo pipefail + rustup target add x86_64-unknown-linux-musl + ZIG_VERSION="0.13.0" + ZIG_DIR="$HOME/.local/zig-${ZIG_VERSION}" + if [ ! -x "${ZIG_DIR}/zig" ]; then + mkdir -p "${ZIG_DIR}" + curl -fsSL "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz" \ + | tar -xJ -C "${ZIG_DIR}" --strip-components=1 + fi + echo "${ZIG_DIR}" >> "$GITHUB_PATH" + cargo install --locked cargo-zigbuild --version ^0.19 + shell: bash + + - name: Build remote-server CLI (static musl via zigbuild) + id: bundle_cli + run: | + script/bundle --channel "$CHANNEL" --arch x86_64 --artifact cli --packages none \ + --target x86_64-unknown-linux-musl + shell: bash + env: + GIT_RELEASE_TAG: ${{ inputs.dmg_tag }} + APPIMAGE_EXTRACT_AND_RUN: 1 + USE_ZIGBUILD: "true" + PKG_CONFIG_ALLOW_CROSS: 1 + + - name: Stage binary as zap-oss + run: cp "${{ steps.bundle_cli.outputs.executable_path }}" zap-oss + shell: bash + + - name: Upload remote-server binary + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: zap-remote-server-linux-x86_64 + path: zap-oss + if-no-files-found: error + retention-days: 7 diff --git a/.github/workflows/test-dmg.yml b/.github/workflows/test-dmg.yml new file mode 100644 index 0000000000..967a7f6271 --- /dev/null +++ b/.github/workflows/test-dmg.yml @@ -0,0 +1,88 @@ +# Test-DMG-Pipeline — schlanker macOS-Build NUR fürs Testen. +# +# Baut ausschließlich das macOS-Build, das gerade getestet werden soll, und lädt +# es als Workflow-Artefakt hoch. KEIN Windows/Linux/Intel, KEIN GitHub-Release +# (anders als zap_release.yml). Gedacht für den schnellen Test-Loop — analog zu +# test-dispatch.yml für Rust-Tests. +# +# Aufruf: gh workflow run test-dmg.yml -R byte5ai/zaplex --ref \ +# [-f arch=aarch64|x86_64] [-f dmg_tag=v0.daemontest] +# +# Das .dmg ist ad-hoc-signiert (wie zap_release.yml, --selfsign) → beim ersten +# Öffnen auf dem Mac einmal: xattr -rd com.apple.quarantine /Applications/Zap.app +# (bzw. das .dmg), siehe issue #51. Kein Developer-ID/Notarize im OSS-Channel. +# +# `dmg_tag` wird als GIT_RELEASE_TAG eingebrannt und bestimmt den remote-server- +# Pfad, den der Client auf dem Ziel-Host prüft: ~/.zap/remote-server/zap-oss-. +# Fixer Default, damit das Daemon-Binary auf dem Ziel-Host deterministisch +# vorab platziert werden kann. + +name: Test DMG + +on: + workflow_dispatch: + inputs: + arch: + description: "macOS-Architektur (aarch64 = Apple Silicon, x86_64 = Intel)" + type: choice + default: aarch64 + options: + - aarch64 + - x86_64 + dmg_tag: + description: "GIT_RELEASE_TAG (bestimmt den remote-server-Pfad auf dem Ziel-Host)" + type: string + default: v0.daemontest + +env: + CARGO_TERM_COLOR: always + CHANNEL: oss + +jobs: + build_dmg: + name: Build Test DMG (macOS ${{ inputs.arch }}) + runs-on: ${{ inputs.arch == 'x86_64' && 'macos-26-intel' || 'macos-26' }} + timeout-minutes: 360 + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - uses: ./.github/actions/prepare_environment + with: + target_os: macos + cache_key: macos-${{ inputs.arch }} + is_self_hosted: false + install_release_deps: true + + - name: Ensure rust target is installed + run: rustup target add ${{ inputs.arch }}-apple-darwin + shell: bash + + - name: Setup Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 + with: + go-version: stable + + - name: Install cargo-bundle + run: script/install_cargo_bundle + + - name: Install create-dmg + run: brew install create-dmg + + # --selfsign = ad-hoc-Signatur (kein Developer-ID-Cert nötig), identisch zu + # zap_release.yml. dmg_name_suffix nur fürs Dateinaming. + - name: Build ${{ inputs.arch }} bundle (ad-hoc signed) + id: bundle_app + run: | + script/bundle --channel "$CHANNEL" --arch ${{ inputs.arch }} \ + --dmg-name-suffix "${{ inputs.arch == 'x86_64' && 'intel' || 'arm64' }}" --selfsign + shell: bash + env: + GIT_RELEASE_TAG: ${{ inputs.dmg_tag }} + + - name: Upload DMG artifact + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: zap-test-dmg-${{ inputs.arch }} + path: ${{ steps.bundle_app.outputs.dmg_path }} + if-no-files-found: error + retention-days: 7