# Release builds on the self-hosted Gitea runner (Linux x64 job containers). # - workflow_dispatch: build + verify packages, keep them as run artifacts (no release). # - tag v*: same, then publish a Gitea release with the packages, only if every build job succeeded. # Windows x64 packages are built on a Windows machine and attached separately (see README). name: release on: push: tags: ['v*'] workflow_dispatch: permissions: contents: read defaults: run: shell: bash jobs: linux-x64: runs-on: ubuntu-latest container: image: node:22-bookworm env: CARGO_TERM_COLOR: never CARGO_BUILD_JOBS: "2" steps: - uses: actions/checkout@v4 - name: Version gate (tag = package.json = core/Cargo.toml) run: node scripts/check-version.mjs - name: System packages (container only) run: | set -euo pipefail apt-get update apt-get install -y --no-install-recommends build-essential cmake curl ca-certificates git \ xvfb xauth libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libgbm1 libgtk-3-0 \ libasound2 libxss1 libxshmfence1 libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 libpango-1.0-0 - name: Rust toolchain run: | set -euo pipefail curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" - name: Tests run: | set -euo pipefail npm ci npm test cargo test --manifest-path core/Cargo.toml --locked - name: Core release build and checks run: | set -euo pipefail cargo build --manifest-path core/Cargo.toml --release --locked node scripts/binary-arch.mjs core/target/release/teamspeach-core --expect linux-x64 node scripts/core-smoke.mjs core/target/release/teamspeach-core - name: Electron UI smoke (Xvfb, offline) env: TEAMSPEACH_SMOKE_EXTRA_ARGS: --no-sandbox run: xvfb-run -a node scripts/smoke-ui.mjs --out smoke-out - name: Package run: node scripts/dist.mjs --os linux --arch x64 - name: Package report (ELF layout of every packaged binary incl. the AppImage runtime) run: | set -euo pipefail report=dist/build-info-linux-x64.txt ldd --version | head -n1 > "$report" git rev-parse HEAD >> "$report" node scripts/elf-pagesize.mjs dist/linux-unpacked dist/TeamsPeach-*.AppImage --page 4096 --json dist/elf-report-linux-x64.json > elf.txt cat elf.txt >> "$report" sha256sum dist/*.AppImage dist/*.tar.gz >> "$report" cat "$report" - uses: actions/upload-artifact@v3 with: name: teamspeach-linux-x64 path: | dist/*.AppImage dist/*.tar.gz dist/build-info-linux-x64.txt dist/elf-report-linux-x64.json if-no-files-found: error linux-arm64: runs-on: ubuntu-latest container: image: node:22-bookworm env: CARGO_TERM_COLOR: never CARGO_BUILD_JOBS: "2" CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++ AR_aarch64_unknown_linux_gnu: aarch64-linux-gnu-ar steps: - uses: actions/checkout@v4 - name: Version gate (tag = package.json = core/Cargo.toml) run: node scripts/check-version.mjs - name: Cross toolchain and user-mode emulator (container only, no binfmt) run: | set -euo pipefail apt-get update apt-get install -y --no-install-recommends build-essential cmake curl ca-certificates git \ gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user - name: Rust toolchain run: | set -euo pipefail curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable --target aarch64-unknown-linux-gnu echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" - name: Core cross build and checks run: | set -euo pipefail cargo build --manifest-path core/Cargo.toml --release --locked --target aarch64-unknown-linux-gnu node scripts/binary-arch.mjs core/target/aarch64-unknown-linux-gnu/release/teamspeach-core --expect linux-arm64 node scripts/elf-pagesize.mjs core/target/aarch64-unknown-linux-gnu/release/teamspeach-core --page 16384 node scripts/core-smoke.mjs core/target/aarch64-unknown-linux-gnu/release/teamspeach-core --wrapper "qemu-aarch64 -L /usr/aarch64-linux-gnu" - name: Package run: | set -euo pipefail npm ci node scripts/dist.mjs --os linux --arch arm64 - name: 16 KiB page check of every packaged ELF incl. the AppImage runtime (Asahi) run: | set -euo pipefail report=dist/build-info-linux-arm64.txt echo "glibc of build sysroot: $(dpkg-query -W -f='${Version}' libc6-dev-arm64-cross)" > "$report" git rev-parse HEAD >> "$report" node scripts/elf-pagesize.mjs dist/linux-arm64-unpacked dist/TeamsPeach-*-arm64.AppImage --page 16384 --json dist/elf-report-linux-arm64.json > elf.txt cat elf.txt >> "$report" sha256sum dist/*.AppImage dist/*.tar.gz >> "$report" cat "$report" - uses: actions/upload-artifact@v3 with: name: teamspeach-linux-arm64 path: | dist/*.AppImage dist/*.tar.gz dist/build-info-linux-arm64.txt dist/elf-report-linux-arm64.json if-no-files-found: error publish: needs: [linux-x64, linux-arm64] if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest container: image: node:22-bookworm permissions: contents: write steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v3 with: path: artifacts - name: Publish release (draft → upload all → publish) env: TOKEN: ${{ secrets.GITEA_TOKEN }} API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }} TAG: ${{ github.ref_name }} run: | set -euo pipefail node scripts/check-version.mjs cat > notes.md <<'EOF' Linux x64 и Linux ARM64 (aarch64) собраны в CI: тесты, офлайн-проверка ядра, проверка выравнивания ELF (для ARM64 — страницы 16 КиБ, включая загрузчик AppImage), см. build-info-*.txt. ARM64 проверен статически и под qemu, не на Apple Silicon. Пакеты не подписаны. Сборка Windows x64 собирается на машине разработчика из того же коммита и прикладывается отдельно с пометкой local. EOF node scripts/publish-release.mjs artifacts notes.md