# Trusted tag pushes publish only after both native architectures and release assembly pass. # Manual dispatch builds/verifies and retains artifacts without publication. # These labels require preprovisioned matching-ISA native runners (no emulated acceptance). name: native-release on: push: tags: ['v*'] workflow_dispatch: permissions: contents: read defaults: run: shell: bash jobs: native-linux: strategy: fail-fast: false matrix: include: - target: x86_64-unknown-linux-gnu runner: teamspeach-native-linux-x64 - target: aarch64-unknown-linux-gnu runner: teamspeach-native-linux-arm64 runs-on: ${{ matrix.runner }} env: CARGO_TERM_COLOR: never CARGO_BUILD_JOBS: "2" TARGET: ${{ matrix.target }} LLVM_HOME: ${{ vars.NATIVE_LLVM_HOME }} SKIA_SOURCE_DIR: ${{ vars.NATIVE_SKIA_SOURCE_DIR }} LIBCLANG_PATH: ${{ vars.NATIVE_LIBCLANG_PATH }} LK_CUSTOM_WEBRTC: ${{ github.workspace }}/target/native-deps/${{ matrix.target }}/webrtc steps: - uses: actions/checkout@v4 - name: Require explicit native source/tool provisioning run: | set -euo pipefail : "${LLVM_HOME:?set NATIVE_LLVM_HOME to installed LLVM}" : "${LIBCLANG_PATH:?set NATIVE_LIBCLANG_PATH to the libclang directory}" : "${SKIA_SOURCE_DIR:?set NATIVE_SKIA_SOURCE_DIR to a dependency-synchronized Skia checkout}" test -x "$LLVM_HOME/bin/clang" test -f "$SKIA_SOURCE_DIR/BUILD.gn" test -x "$SKIA_SOURCE_DIR/bin/gn" echo "$LLVM_HOME/bin" >> "$GITHUB_PATH" for tool in cargo cmake ninja python3 xvfb-run dbus-run-session linuxdeploy appimagetool unsquashfs llvm-readelf; do command -v "$tool" done echo "SKIA_GN_COMMAND=$SKIA_SOURCE_DIR/bin/gn" >> "$GITHUB_ENV" echo "SKIA_NINJA_COMMAND=$(command -v ninja)" >> "$GITHUB_ENV" - name: Tag must match native workspace version run: cargo run --locked -p xtask -- check-version - name: Provision pinned WebRTC sources and archive run: cargo run --locked -p xtask -- deps --target "$TARGET" --llvm-dir "$LLVM_HOME" --jobs "$CARGO_BUILD_JOBS" - name: Rust workspace tests on matching native architecture run: cargo test --locked --workspace --target "$TARGET" --jobs "$CARGO_BUILD_JOBS" - name: Build explicit native smoke harness with default Skia and WebRTC run: cargo run --locked -p xtask -- build --target "$TARGET" --llvm-dir "$LLVM_HOME" --skia-source "$SKIA_SOURCE_DIR" --jobs "$CARGO_BUILD_JOBS" --test-harness true - name: Native offline UI and historical profile migration smoke run: | set -euo pipefail dbus-run-session -- xvfb-run -a cargo run --locked -p xtask -- smoke --target "$TARGET" --scenario offline-ui --out "native-smoke-$TARGET" dbus-run-session -- xvfb-run -a cargo run --locked -p xtask -- smoke --target "$TARGET" --scenario migration --out "native-migration-$TARGET" - name: Rebuild production native app and update helper (no test harness) run: cargo run --locked -p xtask -- build --target "$TARGET" --llvm-dir "$LLVM_HOME" --skia-source "$SKIA_SOURCE_DIR" --jobs "$CARGO_BUILD_JOBS" - name: Package and inspect real native archive payloads run: | set -euo pipefail cargo run --locked -p xtask -- package --target "$TARGET" --out dist/native cargo run --locked -p xtask -- verify-package --target "$TARGET" --out dist/native cp native/native-deps.lock.json "dist/native/$TARGET/native-deps.lock.json" - name: Upload native release bundle and exact provisioning receipt uses: actions/upload-artifact@v3 with: name: teamspeach-native-${{ matrix.target }} path: | dist/native/TeamsPeach-*.AppImage dist/native/TeamsPeach-*.tar.gz dist/native/*.yml dist/native/native-manifest.json dist/native/${{ matrix.target }}/package-report.json dist/native/${{ matrix.target }}/verification.json dist/native/${{ matrix.target }}/native-deps.lock.json if-no-files-found: error - name: Upload measured native smoke evidence if: always() uses: actions/upload-artifact@v3 with: name: native-release-smoke-${{ matrix.target }} path: | native-smoke-${{ matrix.target }}/ native-migration-${{ matrix.target }}/ if-no-files-found: warn assemble: needs: [native-linux] runs-on: teamspeach-native-linux-x64 steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v3 with: name: teamspeach-native-x86_64-unknown-linux-gnu path: artifacts/teamspeach-native-x86_64-unknown-linux-gnu - uses: actions/download-artifact@v3 with: name: teamspeach-native-aarch64-unknown-linux-gnu path: artifacts/teamspeach-native-aarch64-unknown-linux-gnu - name: Gitea transport unit tests (mocked HTTP, no publication) run: python3 -m unittest discover -s xtask -p test_publish_release.py - name: Merge strict native manifests and recheck every package digest run: cargo run --locked -p xtask -- prepare-release --out artifacts - uses: actions/upload-artifact@v3 with: name: native-release-manifest path: artifacts/native-manifest.json if-no-files-found: error publish: needs: [native-linux, assemble] if: startsWith(github.ref, 'refs/tags/v') runs-on: teamspeach-native-linux-x64 permissions: contents: write steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v3 with: name: teamspeach-native-x86_64-unknown-linux-gnu path: artifacts/teamspeach-native-x86_64-unknown-linux-gnu - uses: actions/download-artifact@v3 with: name: teamspeach-native-aarch64-unknown-linux-gnu path: artifacts/teamspeach-native-aarch64-unknown-linux-gnu - name: Validate packages, create draft, upload, verify remote hashes, publish env: GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITHUB_REF: ${{ github.ref }} GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_REPOSITORY: ${{ github.repository }} run: cargo run --locked -p xtask -- publish-release --out artifacts