230 lines
9.2 KiB
YAML
230 lines
9.2 KiB
YAML
# 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: Updater engine behaviour (Xvfb, real electron-updater, emulated release server)
|
|
run: xvfb-run -a node --test test/update-engine.test.mjs
|
|
|
|
- name: Package
|
|
run: node scripts/dist.mjs --os linux --arch x64
|
|
|
|
- name: Update feed matches the packages (name, size, sha512, version)
|
|
run: node scripts/update-feed-check.mjs --version "$(node -p "require('./package.json').version")" dist/*-linux.yml
|
|
|
|
- name: Package report (ELF layout of every packaged binary incl. the AppImage runtime)
|
|
run: |
|
|
set -euo pipefail
|
|
report=dist/build-info-linux-x64.txt
|
|
# sed consumes all input, so ldd never gets SIGPIPE under pipefail (head -n1 caused exit 141).
|
|
ldd --version | sed -n 1p > "$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 dist/*-linux.yml >> "$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
|
|
dist/*-linux.yml
|
|
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
|
|
node scripts/update-feed-check.mjs --version "$(node -p "require('./package.json').version")" dist/*-linux-arm64.yml
|
|
|
|
- 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 dist/*-linux-arm64.yml >> "$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
|
|
dist/*-linux-arm64.yml
|
|
if-no-files-found: error
|
|
|
|
# The AppImage runtime must start on a stock system: run it in a slim container without development
|
|
# packages (no unversioned libz.so), natively for x64 and under qemu-aarch64 for arm64.
|
|
appimage-startup:
|
|
needs: [linux-x64, linux-arm64]
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: node:22-bookworm-slim
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: x64 AppImage runtime starts without development packages
|
|
run: |
|
|
set -euo pipefail
|
|
echo "zlib files present:"; ls /usr/lib/x86_64-linux-gnu/ | grep '^libz\.' || true
|
|
app=$(ls artifacts/teamspeach-linux-x64/TeamsPeach-*.AppImage)
|
|
chmod +x "$app"
|
|
"$app" --appimage-version
|
|
|
|
- name: arm64 AppImage runtime starts under qemu-aarch64 (emulated)
|
|
run: |
|
|
set -euo pipefail
|
|
dpkg --add-architecture arm64
|
|
apt-get update
|
|
apt-get install -y --no-install-recommends qemu-user libc6:arm64 zlib1g:arm64
|
|
echo "arm64 zlib files present:"; ls /usr/lib/aarch64-linux-gnu/ | grep '^libz\.' || true
|
|
app=$(ls artifacts/teamspeach-linux-arm64/TeamsPeach-*-arm64.AppImage)
|
|
chmod +x "$app"
|
|
qemu-aarch64 -L / "$app" --appimage-version
|
|
|
|
publish:
|
|
needs: [linux-x64, linux-arm64, appimage-startup]
|
|
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 and Linux ARM64 (aarch64) are built in CI: tests, offline core check, ELF alignment check
|
|
(16 KiB pages for ARM64, including the AppImage runtime), see build-info-*.txt.
|
|
ARM64 is checked statically and under qemu, not on Apple Silicon. Packages are not signed.
|
|
Windows x64 is built on the developer machine from the same commit and attached separately
|
|
(provenance in *-win-x64-local-build-info.txt).
|
|
Automatic updates (from the first updater-capable version on): Windows x64 NSIS installation and
|
|
Linux AppImage install from this release's latest*.yml / <channel>*.yml feeds after user confirmation;
|
|
zip and tar.gz users are notified and replace files manually.
|
|
EOF
|
|
node scripts/publish-release.mjs artifacts notes.md
|