Files
piik/.github/workflows/repository-hygiene.yml
T
AAA e4bc504c84 feat(protocol)!: use product versions for Domain and App admission
Declare major and minor once at admission and preserve each session's numbers
beside its signing key. Equal majors admit different minors; incompatible
majors reject before consuming launch authority and identify the older side.
App discovery, Native readiness and Web diagnostics keep that direction.

Resolve build identity before compilation. Browser values and displayed version
share the same build input; the Node SDK reads its actual WASM version. Remove
the two private wire identifiers without aliases for obsolete internal builds.

Basis: the accepted compatibility rule in Versioning and ADR-0017. Validated
Core, Web/WASM, Windows reader and App discovery controls. Real packaged SDK
3.0 and 3.1 each completed signed conversation and private-room history against
the other Linux Server minor. Browser/App mixed-artifact acceptance remains open.
2026-11-27 15:00:54 -05:00

662 lines
29 KiB
YAML

name: CI
on:
pull_request:
types: [opened, synchronize, reopened, edited]
push:
branches:
- main
workflow_dispatch:
inputs:
channel_native:
description: Run Native builds, macOS codec checks and Windows window/input checks
required: false
default: false
type: boolean
channel_native_platform:
description: Platform for the Native checks
required: false
default: both
type: choice
options: [both, windows, macos]
nat_helper_macos:
description: Build the standalone NAT survey tool for Apple Silicon and Intel Macs
required: false
default: false
type: boolean
channel_network_lab:
description: Run one isolated network control (never publishes)
required: false
default: none
type: choice
options: [none, ordinary, prepared, recovery, media, browser-relay, public-peer]
app_checks:
description: Build and verify App and Server candidates
required: false
default: false
type: boolean
candidate_version:
description: Optional candidate version (vMAJOR.MINOR.PATCH); never publishes
required: false
type: string
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}${{ github.event_name == 'workflow_dispatch' && inputs.channel_network_lab != 'none' && inputs.channel_network_lab != '' && '-network-lab' || '' }}
cancel-in-progress: false
queue: max
jobs:
nat-helper-macos:
if: github.event_name == 'workflow_dispatch' && inputs.nat_helper_macos == true
runs-on: macos-15
timeout-minutes: 15
env:
MACOSX_DEPLOYMENT_TARGET: '11.0'
CARGO_BUILD_JOBS: '2'
steps:
- uses: actions/checkout@v6
with:
ref: cac7c7fa97553a90d51f5aa66effda3abd72b144
persist-credentials: false
- name: Build and check the standalone universal tool
working-directory: prototype/nat
shell: bash --noprofile --norc -e -o pipefail {0}
run: |
rustup toolchain install 1.91.0 --profile minimal
rustup target add --toolchain 1.91.0 aarch64-apple-darwin x86_64-apple-darwin
# The filtering fixtures bind a second loopback address explicitly.
sudo ifconfig lo0 alias 127.0.0.2
trap 'sudo ifconfig lo0 -alias 127.0.0.2' EXIT
cargo +1.91.0 test --locked --offline
for nat_target in aarch64-apple-darwin x86_64-apple-darwin; do
cargo +1.91.0 build --locked --offline --release --bin piik-nat-lab --target "$nat_target"
done
mkdir -p "$RUNNER_TEMP/nat-helper/package"
lipo -create target/{aarch64,x86_64}-apple-darwin/release/piik-nat-lab -output "$RUNNER_TEMP/nat-helper/package/piik-nat-lab"
codesign --force --sign - "$RUNNER_TEMP/nat-helper/package/piik-nat-lab"
codesign --verify --strict --all-architectures "$RUNNER_TEMP/nat-helper/package/piik-nat-lab"
lipo "$RUNNER_TEMP/nat-helper/package/piik-nat-lab" -verify_arch arm64 x86_64
"$RUNNER_TEMP/nat-helper/package/piik-nat-lab" --help
cp ../../LICENSE "$RUNNER_TEMP/nat-helper/package/LICENSE"
cp README.md "$RUNNER_TEMP/nat-helper/package/README.md"
{
git rev-parse HEAD
rustc +1.91.0 --version
uname -m
lipo -info "$RUNNER_TEMP/nat-helper/package/piik-nat-lab"
otool -L "$RUNNER_TEMP/nat-helper/package/piik-nat-lab"
} > "$RUNNER_TEMP/nat-helper/build.txt"
cp "$RUNNER_TEMP/nat-helper/build.txt" "$RUNNER_TEMP/nat-helper/package/BUILD.txt"
cd "$RUNNER_TEMP/nat-helper"
tar -czf piik-nat-lab-macos-universal.tar.gz -C package piik-nat-lab LICENSE README.md BUILD.txt
(cd package && shasum -a 256 piik-nat-lab) > SHA256SUMS
shasum -a 256 piik-nat-lab-macos-universal.tar.gz >> SHA256SUMS
- uses: actions/upload-artifact@v7
with:
name: piik-nat-lab-macos-universal-cac7c7fa
path: |
${{ runner.temp }}/nat-helper/piik-nat-lab-macos-universal.tar.gz
${{ runner.temp }}/nat-helper/build.txt
${{ runner.temp }}/nat-helper/SHA256SUMS
if-no-files-found: error
retention-days: 7
channel-network:
if: github.event_name == 'workflow_dispatch' && inputs.channel_network_lab != 'none' && inputs.channel_network_lab != '' && inputs.channel_network_lab != 'public-peer'
runs-on: ubuntu-24.04
timeout-minutes: 40
defaults:
run:
shell: bash --noprofile --norc -e -o pipefail {0}
env:
CARGO_BUILD_JOBS: '2'
CARGO_INCREMENTAL: '0'
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- name: Install laboratory tools
run: |
sudo apt-get update
sudo apt-get install -y iproute2 nftables conntrack tcpdump
npm install --prefix "$RUNNER_TEMP/channel-network-tools" --no-save --package-lock=false agent-browser@0.36.0
rustup toolchain install 1.91.0 --profile minimal --target wasm32-unknown-unknown
cargo +1.91.0 install wasm-bindgen-cli --version 0.2.129 --locked
echo "CARGO_TARGET_DIR=$RUNNER_TEMP/channel-network-target" >> "$GITHUB_ENV"
echo "AGENT_BROWSER_BIN=$RUNNER_TEMP/channel-network-tools/node_modules/agent-browser/bin/agent-browser-linux-x64" >> "$GITHUB_ENV"
mkdir -p "$RUNNER_TEMP/channel-network"
- name: Build the matching Native process and Browser adapter
run: |
cargo +1.91.0 build --locked --manifest-path prototype/channel-server/Cargo.toml --example network_lab -j2 2>&1 | tee "$RUNNER_TEMP/channel-network/native-build.log"
node prototype/channel-browser/build.mjs 2>&1 | tee "$RUNNER_TEMP/channel-network/wasm-build.log"
- name: Run the selected kernel-NAT control
env:
CHANNEL_NETWORK_CASE: ${{ inputs.channel_network_lab }}
SOURCE_HEAD: ${{ github.sha }}
CHROMIUM_BIN: /usr/bin/google-chrome
run: |
{
echo "$SOURCE_HEAD"
rustc +1.91.0 --version
node --version
"$AGENT_BROWSER_BIN" --version
"$CHROMIUM_BIN" --version
sha256sum "$CARGO_TARGET_DIR/debug/examples/network_lab" prototype/channel-browser/pkg/piik_channel_browser_bg.wasm
} | tee "$RUNNER_TEMP/channel-network/identity.log"
sudo --preserve-env=PATH,CARGO_TARGET_DIR,AGENT_BROWSER_BIN,CHROMIUM_BIN,SOURCE_HEAD "$(command -v node)" --import tsx scripts/network-lab.ts \
--case "$CHANNEL_NETWORK_CASE" --output "$RUNNER_TEMP/channel-network/$CHANNEL_NETWORK_CASE" 2>&1 | tee "$RUNNER_TEMP/channel-network/run.log"
- name: Save kernel-NAT evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: channel-network-${{ inputs.channel_network_lab }}-${{ github.sha }}
path: ${{ runner.temp }}/channel-network/
if-no-files-found: warn
retention-days: 7
channel-public-peer:
if: github.event_name == 'workflow_dispatch' && inputs.channel_network_lab == 'public-peer'
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version-file: .node-version
- name: Validate the temporary public LAB contract
env:
CHANNEL_PUBLIC_LAB: ${{ secrets.CHANNEL_PUBLIC_LAB }}
run: node prototype/channel-server/browser-public-peer.mjs --check-contract
- name: Install the existing browser driver
run: npm install --prefix "$RUNNER_TEMP/channel-public-tools" --no-save --package-lock=false agent-browser@0.36.0
- name: Confirm the normal Android room and picture
env:
CHANNEL_PUBLIC_LAB: ${{ secrets.CHANNEL_PUBLIC_LAB }}
CHANNEL_ACCEPTANCE_OUTPUT: ${{ runner.temp }}/channel-public-peer
AGENT_BROWSER_BIN: ${{ runner.temp }}/channel-public-tools/node_modules/agent-browser/bin/agent-browser-linux-x64
AGENT_BROWSER_EXECUTABLE_PATH: /usr/bin/google-chrome
run: node prototype/channel-server/browser-public-peer.mjs
- name: Save redacted public-peer evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: channel-public-peer-${{ github.sha }}
path: ${{ runner.temp }}/channel-public-peer/
if-no-files-found: warn
retention-days: 7
channel-native:
if: github.event_name == 'workflow_dispatch' && inputs.channel_native == true
strategy:
fail-fast: false
matrix:
os: >-
${{ fromJSON(inputs.channel_native_platform == 'windows' && '["windows-2025"]' ||
inputs.channel_native_platform == 'macos' && '["macos-15"]' || '["macos-15","windows-2025"]') }}
runs-on: ${{ matrix.os }}
timeout-minutes: 40
defaults:
run:
shell: bash --noprofile --norc -e -o pipefail {0}
env:
MACOSX_DEPLOYMENT_TARGET: '13.0'
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install Rust 1.91.0
run: |
rustup toolchain install 1.91.0 --profile minimal
echo "CARGO_TARGET_DIR=$RUNNER_TEMP/channel-native-target" >> "$GITHUB_ENV"
- name: Build Rust Server and App with capture
if: runner.os == 'macOS'
run: |
mkdir -p "$RUNNER_TEMP/channel-native-logs"
cargo +1.91.0 build --locked --manifest-path prototype/channel-server/Cargo.toml --features capture --bins 2>&1 | tee "$RUNNER_TEMP/channel-native-logs/server-app.log"
- name: Compile Native tests without running them
if: runner.os == 'macOS'
run: cargo +1.91.0 test --locked --manifest-path prototype/channel-native/Cargo.toml --features capture --tests --no-run 2>&1 | tee "$RUNNER_TEMP/channel-native-logs/native-tests.log"
- name: Run synthetic VideoToolbox timing and roundtrip tests
if: runner.os == 'macOS'
timeout-minutes: 2
run: >-
cargo +1.91.0 test --locked --manifest-path prototype/channel-native/Cargo.toml
--features capture --lib capture::macos::tests::
-- --test-threads=1 --nocapture 2>&1 | tee "$RUNNER_TEMP/channel-native-logs/synthetic-h264.log"
- name: Save macOS build and codec logs
if: always() && runner.os == 'macOS'
uses: actions/upload-artifact@v7
with:
name: channel-native-macos-${{ github.sha }}
path: ${{ runner.temp }}/channel-native-logs/
if-no-files-found: warn
retention-days: 7
- name: Set up Node.js for Windows capture dependencies
if: runner.os == 'Windows'
uses: actions/setup-node@v6
with:
node-version-file: .node-version
package-manager-cache: false
- name: Prepare Windows capture dependencies
if: runner.os == 'Windows'
shell: pwsh
run: |
$dependencyPath = Join-Path $env:RUNNER_TEMP 'channel-native-deps'
$dependencyJson = node scripts/windows-capture-deps.mjs $dependencyPath
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
$dependencies = $dependencyJson | ConvertFrom-Json
$dependencies.PSObject.Properties |
ForEach-Object { "$($_.Name)=$($_.Value)" } |
Add-Content -LiteralPath $env:GITHUB_ENV -Encoding utf8
- name: Compile the Windows App library tests
if: runner.os == 'Windows'
env:
# The hosted MSVC linker exceeds its PDB symbol limit for this test binary.
_LINK_: '/DEBUG:NONE'
run: cargo +1.91.0 test --locked --manifest-path prototype/channel-server/Cargo.toml --features capture --lib --no-run
- name: Run the Windows WebView2 window lifecycle regression
if: runner.os == 'Windows'
env:
_LINK_: '/DEBUG:NONE'
timeout-minutes: 2
shell: pwsh
run: |
$runtimeKeys = @(
'HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}',
'HKCU:\Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
)
$runtimeVersions = Get-ItemPropertyValue -Path $runtimeKeys -Name pv -ErrorAction SilentlyContinue
"WebView2 Runtime registry versions: $($runtimeVersions -join ', ')"
"Interactive desktop: $([Environment]::UserInteractive)"
$manifest = 'prototype/channel-server/Cargo.toml'
$testName = 'app_windows::page::cancelled_prepare_and_queued_close_release_native_windows'
cargo +1.91.0 test --locked --manifest-path $manifest --features capture --lib $testName `
-- --ignored --exact --test-threads=1 --nocapture | Tee-Object -Variable testOutput
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
if ($testOutput -notcontains 'running 1 test') { throw "Expected to run $testName" }
- name: Compile the Windows input tests
if: runner.os == 'Windows'
env:
_LINK_: '/DEBUG:NONE'
run: cargo +1.91.0 test --locked --manifest-path prototype/channel-native/Cargo.toml --features capture --lib --no-run
- name: Verify stopping control on the isolated Windows desktop
if: runner.os == 'Windows'
timeout-minutes: 2
shell: pwsh
env:
_LINK_: '/DEBUG:NONE'
PIIK_ISOLATED_WINDOWS_DESKTOP: '1'
run: |
if (-not [Environment]::UserInteractive) { throw 'The input check requires an isolated interactive desktop' }
$testName = 'input::tests::windows_stop_shortcut_on_isolated_desktop'
cargo +1.91.0 test --locked --manifest-path prototype/channel-native/Cargo.toml --features capture --lib $testName `
-- --ignored --exact --test-threads=1 --nocapture | Tee-Object -Variable testOutput
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
if ($testOutput -notcontains 'running 1 test') { throw "Expected to run $testName" }
release-notes:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
- run: npm ci --ignore-scripts
- name: Validate PR release notes
run: node scripts/release-notes.mjs --pull-request
validate:
if: >-
github.event_name != 'pull_request' &&
!(github.event_name == 'workflow_dispatch' &&
(inputs.channel_native == true || inputs.nat_helper_macos == true || (inputs.channel_network_lab != 'none' && inputs.channel_network_lab != '')))
runs-on: ubuntu-latest
outputs:
version: ${{ steps.release.outputs.version }}
publish: ${{ steps.release.outputs.publish }}
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
- name: Validate tracked project state
run: sh scripts/check-project-state.sh
env:
PIIK_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
- name: Install dependencies
run: npm ci
- name: Determine release identity
id: release
env:
PIIK_BUILD_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.candidate_version || '' }}
run: >-
node scripts/release-version.mjs
${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.PIIK_RELEASES_ENABLED == 'true' && 'plan' || 'build' }}
--github-output
- name: Preview release notes
if: steps.release.outputs.publish == 'true'
run: node scripts/release-notes.mjs "$PIIK_RELEASE_VERSION" "$GITHUB_SHA" --github-summary
env:
PIIK_RELEASE_VERSION: ${{ steps.release.outputs.version }}
- name: Install Rust validation tools
run: |
rustup toolchain install 1.91.0 --profile minimal --target wasm32-unknown-unknown
cargo +1.91.0 install wasm-bindgen-cli --version 0.2.129 --locked
cargo +1.91.0 install cargo-about --version 0.9.3 --locked --features cli
echo "CARGO_TARGET_DIR=$RUNNER_TEMP/rust-check" >> "$GITHUB_ENV"
- name: Check Rust and the shared Web UI
run: npm run check
env:
PIIK_BUILD_VERSION: ${{ steps.release.outputs.version }}
PIIK_BUILD_REVISION: ${{ github.sha }}
VITE_PIIK_REVISION: ${{ github.sha }}
release-server:
needs: validate
if: >-
needs.validate.outputs.publish == 'true' ||
(github.event_name == 'workflow_dispatch' && inputs.app_checks == true)
strategy:
fail-fast: false
matrix:
include:
- os: linux
arch: amd64
runner: ubuntu-24.04
artifact: piik-server
- os: linux
arch: arm64
runner: ubuntu-24.04-arm
artifact: piik-server-linux-arm64
- os: windows
arch: amd64
runner: windows-latest
artifact: piik-server-windows-amd64
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
defaults:
run:
shell: bash
env:
PIIK_BUILD_VERSION: ${{ needs.validate.outputs.version }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
- name: Install Rust packaging tools
run: |
rustup toolchain install 1.91.0 --profile minimal --target wasm32-unknown-unknown
cargo +1.91.0 install wasm-bindgen-cli --version 0.2.129 --locked
cargo +1.91.0 install cargo-about --version 0.9.3 --locked --features cli
- name: Install static Server toolchain
if: matrix.os == 'linux'
run: |
sudo apt-get update && sudo apt-get install -y musl-tools binutils
target="$(node --input-type=module -e 'import { SERVER_PACKAGE_TARGETS } from "./scripts/server-package-targets.mjs"; console.log(SERVER_PACKAGE_TARGETS.find(t => t.goos === process.argv[1] && t.goarch === process.argv[2]).rustTarget)' '${{ matrix.os }}' '${{ matrix.arch }}')"
rustup target add --toolchain 1.91.0 "$target"
- name: Install dependencies
run: npm ci
- name: Package Server release
if: matrix.os == 'linux'
run: >-
node scripts/package-server-release.mjs "$RUNNER_TEMP/server-release"
--os "${{ matrix.os }}" --arch "${{ matrix.arch }}"
--container-image "piik-candidate:$GITHUB_SHA-${{ matrix.arch }}"
- name: Package Windows Server release
if: matrix.os == 'windows'
run: >-
node scripts/package-server-release.mjs "$RUNNER_TEMP/server-release"
--os "${{ matrix.os }}" --arch "${{ matrix.arch }}"
- name: Check the container and deployment recipe
if: matrix.os == 'linux'
run: npm run check:container -- "piik-candidate:$GITHUB_SHA-${{ matrix.arch }}" "$GITHUB_SHA"
- name: Save the verified container
if: matrix.os == 'linux'
run: docker save "piik-candidate:$GITHUB_SHA-${{ matrix.arch }}" --output "$RUNNER_TEMP/piik-container-${{ matrix.arch }}.tar"
- name: Upload the verified container
if: matrix.os == 'linux'
uses: actions/upload-artifact@v7
with:
name: piik-container-${{ matrix.arch }}-${{ github.sha }}
path: ${{ runner.temp }}/piik-container-${{ matrix.arch }}.tar
if-no-files-found: error
retention-days: 14
- name: Upload Server release
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact }}-${{ github.sha }}
path: ${{ runner.temp }}/server-release/*
if-no-files-found: error
retention-days: 14
release-apps:
needs:
- validate
if: >-
needs.validate.outputs.publish == 'true' ||
(github.event_name == 'workflow_dispatch' && inputs.app_checks == true)
strategy:
fail-fast: false
matrix:
include:
- target: windows-amd64
runner: windows-latest
# Native Linux capture links system libraries; keep both architectures
# on the same explicit build baseline instead of following latest.
- target: linux-amd64
runner: ubuntu-24.04
- target: linux-arm64
runner: ubuntu-24.04-arm
- target: darwin-arm64
runner: macos-15
- target: darwin-amd64
runner: macos-15-intel
- target: android-universal
runner: ubuntu-24.04
runs-on: ${{ matrix.runner }}
timeout-minutes: ${{ matrix.target == 'android-universal' && 45 || 35 }}
env:
PIIK_BUILD_VERSION: ${{ needs.validate.outputs.version }}
PIIK_UPDATE_PUBLIC_KEY: ${{ vars.PIIK_UPDATE_PUBLIC_KEY }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
- name: Set up Go
if: matrix.target == 'android-universal'
uses: actions/setup-go@v6
with:
go-version-file: .go-version
cache: false
- name: Install dependencies
run: npm ci
- name: Install Rust packaging tools
run: |
rustup toolchain install 1.91.0 --profile minimal --target wasm32-unknown-unknown
cargo +1.91.0 install wasm-bindgen-cli --version 0.2.129 --locked
cargo +1.91.0 install cargo-about --version 0.9.3 --locked --features cli
- name: Install Linux packaging and native capture dependencies
if: startsWith(matrix.target, 'linux-')
run: >-
sudo apt-get update && sudo apt-get install -y
zip
unzip
libgstreamer1.0-dev
libgstreamer-plugins-base1.0-dev
gstreamer1.0-pipewire
gstreamer1.0-plugins-bad
gstreamer1.0-pulseaudio
- name: Build and verify App candidate
if: matrix.target != 'android-universal'
run: >-
node scripts/package-app-candidate.mjs
"${{ matrix.target }}"
"${{ runner.temp }}/app-release"
- name: Set up Android Java
if: matrix.target == 'android-universal'
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
- name: Set up Android Gradle
if: matrix.target == 'android-universal'
uses: gradle/actions/setup-gradle@v6
with:
gradle-version: '8.11.1'
cache-provider: basic
- name: Install pinned Android build tools
if: matrix.target == 'android-universal'
run: |
"$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" 'platforms;android-35' 'build-tools;35.0.0' 'ndk;30.0.16248370'
echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/30.0.16248370" >> "$GITHUB_ENV"
echo "GRADLE_HOME=$(dirname "$(dirname "$(readlink -f "$(command -v gradle)")")")" >> "$GITHUB_ENV"
rustup target add --toolchain 1.91.0 aarch64-linux-android x86_64-linux-android
- name: Prepare Android signing
if: matrix.target == 'android-universal'
env:
PIIK_PUBLISH: ${{ needs.validate.outputs.publish }}
PIIK_ANDROID_KEYSTORE_BASE64: ${{ secrets.PIIK_ANDROID_KEYSTORE_BASE64 }}
PIIK_ANDROID_STORE_PASSWORD: ${{ secrets.PIIK_ANDROID_STORE_PASSWORD }}
PIIK_ANDROID_KEY_ALIAS: ${{ secrets.PIIK_ANDROID_KEY_ALIAS }}
PIIK_ANDROID_KEY_PASSWORD: ${{ secrets.PIIK_ANDROID_KEY_PASSWORD }}
run: |
if [ "$PIIK_PUBLISH" = true ]; then
for name in PIIK_ANDROID_KEYSTORE_BASE64 PIIK_ANDROID_STORE_PASSWORD PIIK_ANDROID_KEY_ALIAS PIIK_ANDROID_KEY_PASSWORD; do
if [ -z "${!name}" ]; then echo "Android publication requires $name" >&2; exit 1; fi
done
umask 077
printf '%s' "$PIIK_ANDROID_KEYSTORE_BASE64" | base64 --decode > "$RUNNER_TEMP/piik-android.keystore"
else
# Manual candidates exercise the same release variant with a disposable key.
keytool -genkeypair -keystore "$RUNNER_TEMP/piik-android.keystore" -storetype PKCS12 \
-storepass candidate-password -keypass candidate-password -alias piik-candidate \
-keyalg RSA -keysize 3072 -validity 2 -dname 'CN=Piik CI candidate' -noprompt
fi
- name: Build and verify Android release APK
if: matrix.target == 'android-universal'
env:
PIIK_ANDROID_KEYSTORE: ${{ runner.temp }}/piik-android.keystore
PIIK_ANDROID_STORE_PASSWORD: ${{ needs.validate.outputs.publish == 'true' && secrets.PIIK_ANDROID_STORE_PASSWORD || 'candidate-password' }}
PIIK_ANDROID_KEY_ALIAS: ${{ needs.validate.outputs.publish == 'true' && secrets.PIIK_ANDROID_KEY_ALIAS || 'piik-candidate' }}
PIIK_ANDROID_KEY_PASSWORD: ${{ needs.validate.outputs.publish == 'true' && secrets.PIIK_ANDROID_KEY_PASSWORD || 'candidate-password' }}
run: node scripts/build-android.mjs --release --output "$RUNNER_TEMP/app-release"
- name: Remove temporary Android signing material
if: always() && matrix.target == 'android-universal'
run: rm -f -- "$RUNNER_TEMP/piik-android.keystore"
- name: Upload App release candidate
uses: actions/upload-artifact@v7
with:
name: piik-app-${{ matrix.target }}-${{ github.sha }}
path: ${{ runner.temp }}/app-release/*
if-no-files-found: error
compression-level: 0
retention-days: 14
publish:
needs:
- validate
- release-server
- release-apps
if: needs.validate.outputs.publish == 'true'
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
packages: write
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Download Server release
uses: actions/download-artifact@v8
with:
pattern: piik-server*-${{ github.sha }}
path: ${{ runner.temp }}/publish-release
merge-multiple: true
- name: Download App release candidates
uses: actions/download-artifact@v8
with:
pattern: piik-app-*-${{ github.sha }}
path: ${{ runner.temp }}/publish-release
merge-multiple: true
- name: Download the verified container
uses: actions/download-artifact@v8
with:
pattern: piik-container-*-${{ github.sha }}
path: ${{ runner.temp }}/container
merge-multiple: true
- name: Load the verified container
run: |
for arch in amd64 arm64; do
docker load --input "$RUNNER_TEMP/container/piik-container-$arch.tar"
done
- name: Log in to GitHub Container Registry
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
# Local descriptors/manifests/checksums are validated before publishing.
# Signed update metadata accompanies packages when the App trust root is configured.
- name: Publish packages with release notes and checksums
run: >-
node scripts/publish-release.mjs
"$RUNNER_TEMP/publish-release" "$PIIK_RELEASE_VERSION" "$GITHUB_SHA"
env:
GH_TOKEN: ${{ github.token }}
PIIK_RELEASE_VERSION: ${{ needs.validate.outputs.version }}
PIIK_UPDATE_PUBLIC_KEY: ${{ vars.PIIK_UPDATE_PUBLIC_KEY }}
PIIK_UPDATE_SIGNING_KEY: ${{ secrets.PIIK_UPDATE_SIGNING_KEY }}
- name: Retain original signed update metadata
if: always() && vars.PIIK_UPDATE_PUBLIC_KEY != ''
uses: actions/upload-artifact@v7
with:
name: piik-update-${{ github.sha }}
path: ${{ runner.temp }}/publish-release/signed-update/*
if-no-files-found: ignore
retention-days: 14
- name: Publish the matching Server container
run: >-
node scripts/publish-container.mjs "piik-candidate:$GITHUB_SHA"
"$RUNNER_TEMP/publish-release" "$PIIK_RELEASE_VERSION" "$GITHUB_SHA"
env:
GH_TOKEN: ${{ github.token }}
PIIK_RELEASE_VERSION: ${{ needs.validate.outputs.version }}