MeshChatX/.github/workflows/build-release.yml

708 lines
29 KiB
YAML

# Single tagged-release pipeline: Linux release assets, Windows + macOS Electron
# builds, Flatpak, Android APKs (dev/master track tags via android-apk-tag.yml), SLSA
# provenance (generic generator: Linux, desktop, optional Android+Flatpak), optional cosign bundles, and one draft GitHub release.
# One workflow run per tag keeps the release graph immutable.
#
# Pinned first-party actions (bump tag and SHA together when upgrading):
# actions/checkout@v6.0.1 8e8c483db84b4bee98b60c0593521ed34d9990e8
# actions/setup-python@v6.2.0 a309ff8b426b58ec0e2a45f0f869d46889d02405
# actions/setup-node@v6.1.0 395ad3262231945c25e8478fd5baf05154b1d79f
# actions/upload-artifact@v5.0.0 330a01c490aca151604b8cf639adc76d48f6c5d4
# actions/download-artifact@v5.0.0 634f93cb2916e3fdff6788551b99b062d0335ce0
# actions/cache@v4.2.0 1bd1e32a3bdc45362d1e726936510720a7c30a57
# actions/setup-java@v4.7.1 c5195efecf7bdfc987ee8bae7a71cb8b11521c00
#
# SLSA generator: pin by tag (@vX.Y.Z), not by commit SHA.
# Prefer compile-generator: true. builder-fetch.sh only downloads prebuilts
# when BUILDER_REF is refs/tags/vX.Y.Z. GitHub OIDC often reports a bare SHA
# even for tag-pinned callers, so Generate builder fails quietly and attest
# then exits 127 (slsa-generator-generic-linux-amd64 missing). Compiling from
# source skips that download path. Upstream: slsa-github-generator#4216 #4503.
# slsa-framework/slsa-github-generator/generator_generic_slsa3.yml@v2.1.0
# (tag v2.1.0 = f7dd8c54c2067bafc12ca7a55595d5ee9b75204a)
name: Build release
on:
push:
tags:
- "*"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: build-release-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
NODE_OPTIONS: --max-old-space-size=8192
PYTHON_VERSION: "3.14"
NODE_VERSION: "24"
UV_VERSION: "0.11.15"
PNPM_VERSION: "11.1.2"
COSIGN_VERSION: "3.0.6"
# Official .deb from aquasecurity/trivy releases; scripts/ci/setup-trivy.sh verifies
# checksums.txt (sigstore) + .deb SHA256 + .deb (sigstore). Bump with upstream tags.
TRIVY_VERSION: "0.69.3"
jobs:
frontend:
name: Build frontend artifact
uses: ./.github/workflows/frontend-build.yml
permissions:
contents: read
with:
artifact_name: meshchatx-frontend-release-${{ github.run_id }}-${{ github.run_attempt }}
retention_days: 7
pnpm_version: "11.1.2"
frontend-android:
name: Build frontend (Android / Python 3.11)
if: startsWith(github.ref, 'refs/tags/')
uses: ./.github/workflows/frontend-build.yml
permissions:
contents: read
with:
artifact_name: meshchatx-frontend-android-rel-${{ github.run_id }}-${{ github.run_attempt }}
retention_days: 7
python_version: "3.11"
pnpm_version: "11.1.2"
android-release:
name: Android APKs (tag)
if: startsWith(github.ref, 'refs/tags/')
needs: [frontend-android]
secrets: inherit
uses: ./.github/workflows/android-apk-tag.yml
with:
frontend_artifact_name: ${{ needs.frontend-android.outputs.artifact_name }}
run_unit_tests: true
linux-release:
name: Linux release assets (${{ matrix.arch }})
needs: frontend
strategy:
fail-fast: false
matrix:
include:
- arch: x64
runner: ubuntu-latest
setup_trivy: true
- arch: arm64
runner: ubuntu-24.04-arm
setup_trivy: false
runs-on: ${{ matrix.runner }}
timeout-minutes: 120
permissions:
contents: read
env:
FRONTEND_ARTIFACT_NAME: ${{ needs.frontend.outputs.artifact_name }}
MESHCHATX_FRONTEND_PREBUILT: "1"
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Set up Python and UV
uses: ./.github/actions/setup-python-uv
with:
python-version: ${{ env.PYTHON_VERSION }}
uv-version: ${{ env.UV_VERSION }}
- name: Set up Node and pnpm
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ env.NODE_VERSION }}
pnpm-version: ${{ env.PNPM_VERSION }}
- name: Cache electron-builder toolsets
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: ~/.cache/electron-builder
key: electron-builder-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'package.json') }}
restore-keys: |
electron-builder-${{ runner.os }}-${{ runner.arch }}-
- name: Linux packaging APT dependencies
run: bash scripts/ci/github-apt-linux-packaging.sh
- name: Install dependencies
run: bash scripts/ci/github-install-deps.sh
- name: Fetch frontend artifact
uses: ./.github/actions/fetch-frontend-artifact
with:
artifact-name: ${{ env.FRONTEND_ARTIFACT_NAME }}
- name: Setup Task
if: matrix.setup_trivy
env:
GITHUB_TOKEN: ${{ github.token }}
run: sh scripts/ci/setup-task.sh
- name: Apt update (for Trivy .deb)
if: matrix.setup_trivy
run: sh scripts/ci/exec-priv.sh apt-get update -qq
- name: Setup Trivy
if: matrix.setup_trivy
run: sh scripts/ci/setup-trivy.sh
- name: Build release-assets
env:
GITHUB_TOKEN: ${{ github.token }}
run: bash scripts/ci/github-build-linux-release-assets.sh
- name: Upload Linux release artifact (${{ matrix.arch }})
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
with:
name: meshchatx-linux-release-${{ matrix.arch }}-${{ github.ref_name }}-${{ github.run_id }}
path: release-assets/
if-no-files-found: error
retention-days: 30
collect-linux-slsa-subjects:
name: SLSA subjects + cosign (Linux)
needs: [linux-release]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
outputs:
hashes: ${{ steps.hash.outputs.hashes }}
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Download x64 artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-linux-release-x64-${{ github.ref_name }}-${{ github.run_id }}
path: release-assets
- name: Download arm64 artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-linux-release-arm64-${{ github.ref_name }}-${{ github.run_id }}
path: release-assets
- name: SLSA subject hashes
id: hash
run: bash scripts/ci/github-slsa-hashes-release-assets.sh
- name: SLSA attestations (cosign)
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
GITHUB_WORKFLOW: ${{ github.workflow }}
GITHUB_WORKFLOW_FILE: build-release.yml
COSIGN_VERSION: ${{ env.COSIGN_VERSION }}
run: |
set -eu
if [ -z "${COSIGN_PRIVATE_KEY:-}" ]; then
echo "Skipping cosign attestations (no COSIGN_PRIVATE_KEY)."
exit 0
fi
sh scripts/ci/setup-cosign.sh "${COSIGN_VERSION}"
printf '%s\n' "$COSIGN_PRIVATE_KEY" > /tmp/cosign.key
chmod 600 /tmp/cosign.key
export COSIGN_KEY_PATH=/tmp/cosign.key
sh scripts/ci/attest-release-assets.sh ./release-assets
rm -f /tmp/cosign.key
flatpak:
name: Flatpak (electron-builder)
needs: frontend
runs-on: ubuntu-latest
timeout-minutes: 90
permissions:
contents: read
env:
FRONTEND_ARTIFACT_NAME: ${{ needs.frontend.outputs.artifact_name }}
MESHCHATX_FRONTEND_PREBUILT: "1"
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Install flatpak toolchain
run: |
set -euo pipefail
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends \
flatpak \
flatpak-builder \
elfutils \
zstd \
desktop-file-utils \
appstream
- name: Install flatpak runtimes (user scope)
run: |
set -euo pipefail
bash scripts/ensure-flatpak-flathub-remote.sh
flatpak --user install -y --noninteractive flathub \
org.freedesktop.Platform//25.08 \
org.freedesktop.Sdk//25.08 \
org.electronjs.Electron2.BaseApp//25.08
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install UV (PyPI pin)
env:
UV_VERSION: ${{ env.UV_VERSION }}
run: bash scripts/ci/github-install-uv.sh
- name: Cache UV downloads
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }}
restore-keys: |
${{ runner.os }}-uv-
- name: Set up Node and pnpm
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ env.NODE_VERSION }}
pnpm-version: ${{ env.PNPM_VERSION }}
- name: Install dependencies
run: bash scripts/ci/github-install-deps.sh
- name: Download frontend artifact
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: ${{ env.FRONTEND_ARTIFACT_NAME }}
path: meshchatx/public
- name: Verify frontend artifact contents
run: |
set -euo pipefail
test -f meshchatx/public/index.html
test -d meshchatx/public/assets
test -d meshchatx/public/reticulum-docs-bundled/current
- name: Build flatpak bundle
run: bash scripts/ci/github-build-linux-flatpak.sh
- name: List flatpak output
run: |
set -euo pipefail
ls -la dist 2>/dev/null || true
find dist -maxdepth 3 -type f \( -name "*.flatpak" -o -name "*.flatpakref" \) -print
- name: Upload flatpak artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
with:
name: meshchatx-linux-flatpak-${{ github.ref_name }}-${{ github.run_id }}
path: dist/*.flatpak
if-no-files-found: error
retention-days: 30
build-release:
name: Build release (${{ matrix.label }})
needs: frontend
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
label: windows
timeout: 120
build_script: scripts/ci/github-build-windows.sh
artifact_prefix: meshchatx-windows
- os: macos-latest
label: macos
timeout: 180
build_script: scripts/ci/github-build-macos.sh
artifact_prefix: meshchatx-macos
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.timeout }}
defaults:
run:
shell: bash
env:
FRONTEND_ARTIFACT_NAME: ${{ needs.frontend.outputs.artifact_name }}
MESHCHATX_FRONTEND_PREBUILT: "1"
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install UV (PyPI pin)
env:
UV_VERSION: ${{ env.UV_VERSION }}
run: bash scripts/ci/github-install-uv.sh
- name: Set up Node and pnpm
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ env.NODE_VERSION }}
pnpm-version: ${{ env.PNPM_VERSION }}
- name: Install dependencies
run: bash scripts/ci/github-install-deps.sh
- name: Install Rosetta (Apple Silicon)
if: matrix.label == 'macos'
run: /usr/sbin/softwareupdate --install-rosetta --agree-to-license || true
- name: Ensure x86_64 Homebrew (/usr/local) for universal slice
if: matrix.label == 'macos'
run: bash scripts/ci/github-ensure-macos-x86-64-homebrew.sh
- name: Set up Python x64 for cx_Freeze universal slice
id: python_x64
if: matrix.label == 'macos'
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
update-environment: false
- name: Install x86_64 libyaml for universal cx_Freeze slice
if: matrix.label == 'macos'
run: |
set -euo pipefail
# x86_64 libyaml for the darwin-x64 cx_Freeze slice (see
# github-ensure-macos-x86-64-homebrew.sh; /usr/local/bin/brew is
# guaranteed before this step on Apple Silicon runners).
arch -x86_64 /usr/local/bin/brew install libyaml || true
- name: Install x86_64 codec2 for pycodec2 (universal slice)
if: matrix.label == 'macos'
run: |
set -euo pipefail
arch -x86_64 /usr/local/bin/brew install codec2
_codec2="$(arch -x86_64 /usr/local/bin/brew --prefix codec2)"
test -f "${_codec2}/include/codec2/codec2.h"
shopt -s nullglob
_libs=("${_codec2}/lib"/libcodec2*.dylib)
if [[ ${#_libs[@]} -eq 0 ]]; then
echo "no libcodec2*.dylib under ${_codec2}/lib" >&2
exit 1
fi
- name: Install Rust x86_64-apple-darwin target (cbor2 x64 slice)
if: matrix.label == 'macos'
run: bash scripts/ci/github-macos-rust-x64-target.sh
- name: Install project deps into x64 Python (mac universal cx_Freeze)
if: matrix.label == 'macos'
env:
PY_X64: ${{ steps.python_x64.outputs.python-path }}
run: bash scripts/ci/github-install-macos-x64-python-deps.sh
- name: Download frontend artifact
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: ${{ env.FRONTEND_ARTIFACT_NAME }}
path: meshchatx/public
- name: Verify frontend artifact contents
run: |
set -euo pipefail
test -f meshchatx/public/index.html
test -d meshchatx/public/assets
test -d meshchatx/public/reticulum-docs-bundled/current
- name: Build distributables
run: bash "${{ matrix.build_script }}"
- name: Upload dist artifacts
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
with:
name: ${{ matrix.artifact_prefix }}-${{ github.ref_name }}-${{ github.run_id }}
path: dist/
if-no-files-found: error
collect-desktop-slsa-subjects:
name: SLSA subjects (Windows + macOS)
needs: [build-release]
if: >-
always() &&
!cancelled() &&
startsWith(github.ref, 'refs/tags/') &&
(needs.build-release.result == 'success' || needs.build-release.result == 'failure')
runs-on: ubuntu-latest
outputs:
hashes: ${{ steps.hash.outputs.hashes }}
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Download Windows dist
continue-on-error: true
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-windows-${{ github.ref_name }}-${{ github.run_id }}
path: dl/win
- name: Download macOS dist
continue-on-error: true
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-macos-${{ github.ref_name }}-${{ github.run_id }}
path: dl/mac
- name: Hash desktop artifacts
id: hash
run: bash scripts/ci/github-slsa-hashes-desktop-dist.sh dl/win dl/mac
slsa-provenance-linux:
name: SLSA provenance (Linux)
needs: [collect-linux-slsa-subjects]
if: startsWith(github.ref, 'refs/tags/')
permissions:
id-token: write
contents: write
actions: read
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
with:
base64-subjects: ${{ needs.collect-linux-slsa-subjects.outputs.hashes }}
upload-assets: false
compile-generator: true
provenance-name: meshchatx-linux-${{ github.ref_name }}.intoto.jsonl
slsa-provenance-desktop:
name: SLSA provenance (Windows + macOS)
needs: [collect-desktop-slsa-subjects]
if: >-
always() &&
!cancelled() &&
startsWith(github.ref, 'refs/tags/') &&
needs.collect-desktop-slsa-subjects.result == 'success'
permissions:
id-token: write
contents: write
actions: read
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
with:
base64-subjects: ${{ needs.collect-desktop-slsa-subjects.outputs.hashes }}
upload-assets: false
compile-generator: true
provenance-name: meshchatx-desktop-${{ github.ref_name }}.intoto.jsonl
collect-android-flatpak-slsa-subjects:
name: SLSA subjects (Android APK + Flatpak)
needs: [android-release, flatpak]
if: >-
always() &&
!cancelled() &&
startsWith(github.ref, 'refs/tags/') &&
(needs.android-release.result == 'success' || needs.android-release.result == 'skipped') &&
(needs.flatpak.result == 'success' || needs.flatpak.result == 'failure')
runs-on: ubuntu-latest
outputs:
hashes: ${{ steps.hash.outputs.hashes }}
has_subjects: ${{ steps.hash.outputs.has_subjects }}
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Download Android APK bundle
continue-on-error: true
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-android-apks-${{ github.ref_name }}-${{ github.run_id }}
path: dl/android
- name: Download Flatpak artifact
continue-on-error: true
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-linux-flatpak-${{ github.ref_name }}-${{ github.run_id }}
path: dl/flatpak
- name: Hash Android / Flatpak artifacts
id: hash
run: bash scripts/ci/github-slsa-hashes-apk-flatpak.sh dl/android dl/flatpak
slsa-provenance-android-flatpak:
name: SLSA provenance (Android + Flatpak)
needs: [collect-android-flatpak-slsa-subjects]
if: ${{ startsWith(github.ref, 'refs/tags/') && needs.collect-android-flatpak-slsa-subjects.outputs.has_subjects == 'true' }}
permissions:
id-token: write
contents: write
actions: read
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
with:
base64-subjects: ${{ needs.collect-android-flatpak-slsa-subjects.outputs.hashes }}
upload-assets: false
compile-generator: true
provenance-name: meshchatx-android-flatpak-${{ github.ref_name }}.intoto.jsonl
draft-github-release:
name: ${{ startsWith(github.ref_name, 'nightly-') && 'Nightly GitHub release (all assets + SLSA)' || startsWith(github.ref_name, 'preview-dev-') && 'Preview-dev GitHub release (all assets + SLSA)' || startsWith(github.ref_name, 'preview-') && 'Preview GitHub release (all assets + SLSA)' || 'Draft GitHub release (all assets + SLSA)' }}
needs:
- linux-release
- collect-linux-slsa-subjects
- slsa-provenance-linux
- build-release
- collect-desktop-slsa-subjects
- slsa-provenance-desktop
- flatpak
- android-release
- collect-android-flatpak-slsa-subjects
- slsa-provenance-android-flatpak
if: >-
always() &&
!cancelled() &&
startsWith(github.ref, 'refs/tags/') &&
needs.linux-release.result == 'success' &&
needs.collect-linux-slsa-subjects.result == 'success' &&
needs.slsa-provenance-linux.result == 'success' &&
(needs.build-release.result == 'success' || needs.build-release.result == 'failure') &&
needs.collect-desktop-slsa-subjects.result == 'success' &&
needs.slsa-provenance-desktop.result == 'success'
runs-on: ubuntu-latest
timeout-minutes: 45
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Download Linux release assets (x64)
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-linux-release-x64-${{ github.ref_name }}-${{ github.run_id }}
path: upload
- name: Download Linux release assets (arm64)
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-linux-release-arm64-${{ github.ref_name }}-${{ github.run_id }}
path: upload
- name: Download Windows dist
continue-on-error: true
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-windows-${{ github.ref_name }}-${{ github.run_id }}
path: upload/win
- name: Download macOS dist
continue-on-error: true
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-macos-${{ github.ref_name }}-${{ github.run_id }}
path: upload/mac
- name: Download Flatpak artifact
continue-on-error: true
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-linux-flatpak-${{ github.ref_name }}-${{ github.run_id }}
path: upload/flatpak
- name: Download Android APK bundle
continue-on-error: true
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-android-apks-${{ github.ref_name }}-${{ github.run_id }}
path: upload/android
- name: Download SLSA provenance (Linux)
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: ${{ needs.slsa-provenance-linux.outputs.provenance-name }}
path: upload
- name: Download SLSA provenance (desktop)
continue-on-error: true
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: ${{ needs.slsa-provenance-desktop.outputs.provenance-name }}
path: upload
- name: Download SLSA provenance (Android + Flatpak)
continue-on-error: true
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: meshchatx-android-flatpak-${{ github.ref_name }}.intoto.jsonl
path: upload
- name: SLSA cosign bundles (desktop only)
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
GITHUB_WORKFLOW: ${{ github.workflow }}
GITHUB_WORKFLOW_FILE: build-release.yml
COSIGN_VERSION: ${{ env.COSIGN_VERSION }}
run: |
set -eu
if [ -z "${COSIGN_PRIVATE_KEY:-}" ]; then
echo "Skipping cosign attestations (no COSIGN_PRIVATE_KEY)."
exit 0
fi
sh scripts/ci/setup-cosign.sh "${COSIGN_VERSION}"
printf '%s\n' "$COSIGN_PRIVATE_KEY" > /tmp/cosign.key
chmod 600 /tmp/cosign.key
export COSIGN_KEY_PATH=/tmp/cosign.key
for d in upload/win upload/mac; do
if [ -d "$d" ]; then
sh scripts/ci/attest-release-assets.sh "$d"
fi
done
rm -f /tmp/cosign.key
- name: Upload release assets (draft then publish for nightly/preview)
env:
GH_TOKEN: ${{ github.token }}
run: bash scripts/ci/github-draft-release-upload-assets.sh upload
release-artifact-gate:
name: Verify required tagged release artifacts
if: >-
always() &&
!cancelled() &&
startsWith(github.ref, 'refs/tags/')
needs:
- flatpak
- build-release
- draft-github-release
runs-on: ubuntu-latest
steps:
- name: Fail when required build jobs did not succeed
run: |
set -euo pipefail
fail=0
if [[ "${{ needs.flatpak.result }}" != "success" ]]; then
echo "::error::Flatpak job did not succeed (${{ needs.flatpak.result }})"
fail=1
fi
if [[ "${{ needs.build-release.result }}" != "success" ]]; then
echo "::error::Desktop build job did not succeed (${{ needs.build-release.result }})"
fail=1
fi
if [[ "${{ needs.draft-github-release.result }}" != "success" ]]; then
echo "::error::Draft release job did not succeed (${{ needs.draft-github-release.result }})"
fail=1
fi
exit "$fail"