feat: add Linux Electron release smoke builds

Adds an opt-in input to build Linux Electron artifacts in the smoke workflow
Builds and validates AppImage releases for x64 and arm64
Uploads Linux AppImage and update manifest artifacts
This commit is contained in:
Bohdan Triapitsyn
2026-07-28 12:41:50 +03:00
parent 3a5c399298
commit 72fa464910
+107
View File
@@ -23,6 +23,11 @@ on:
required: false required: false
default: true default: true
type: boolean type: boolean
build_linux:
description: Build Linux Electron AppImage artifacts
required: false
default: true
type: boolean
retention_days: retention_days:
description: Artifact retention days description: Artifact retention days
required: false required: false
@@ -266,3 +271,105 @@ jobs:
packages/electron/dist/latest.yml packages/electron/dist/latest.yml
if-no-files-found: error if-no-files-found: error
retention-days: ${{ fromJSON(inputs.retention_days) }} retention-days: ${{ fromJSON(inputs.retention_days) }}
build-linux-electron:
if: ${{ inputs.build_linux }}
name: Build Linux Electron (${{ matrix.arch }})
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
arch: x64
host_arch: x86_64
artifact_arch: x86_64
manifest: latest-linux.yml
- runner: ubuntu-24.04-arm
arch: arm64
host_arch: aarch64
artifact_arch: arm64
manifest: latest-linux-arm64.yml
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout selected ref
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref || github.ref }}
- name: Setup bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '22'
- name: Verify native Linux architecture
env:
EXPECTED_HOST_ARCH: ${{ matrix.host_arch }}
OPENCHAMBER_TARGET_ARCH: ${{ matrix.arch }}
run: |
set -euo pipefail
test "$(uname -m)" = "$EXPECTED_HOST_ARCH"
test "$(node -p 'process.arch')" = "$OPENCHAMBER_TARGET_ARCH"
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Get build versions
id: versions
shell: bash
run: |
echo "opencode_cli=$(node -p "require('./package.json').dependencies['@opencode-ai/sdk']")" >> "$GITHUB_OUTPUT"
echo "app=$(node -p "require('./packages/electron/package.json').version")" >> "$GITHUB_OUTPUT"
- name: Cache bundled OpenCode CLI artifact
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: packages/electron/.cache/opencode-cli
key: opencode-cli-${{ runner.os }}-${{ matrix.arch }}-${{ steps.versions.outputs.opencode_cli }}
restore-keys: |
opencode-cli-${{ runner.os }}-${{ matrix.arch }}-
- name: Run focused Electron release tests
working-directory: packages/electron
run: |
bun run test:architecture
bun run test:updater
- name: Build and package Linux AppImage
working-directory: packages/electron
env:
OPENCHAMBER_TARGET_ARCH: ${{ matrix.arch }}
run: |
set -euo pipefail
bun run build:web-assets
bun run prepare:opencode-cli
bun run verify:opencode-cli
bun run bundle:main
bun run rebuild:native
node ./scripts/package.mjs --linux --${{ matrix.arch }} --publish=never
bun run verify:opencode-cli:packaged
bun run verify:linux-appimage
- name: Validate Linux update manifest
working-directory: packages/electron
env:
VERSION: ${{ steps.versions.outputs.app }}
ARTIFACT_ARCH: ${{ matrix.artifact_arch }}
MANIFEST: ${{ matrix.manifest }}
run: |
set -euo pipefail
APPIMAGE="dist/OpenChamber-${VERSION}-linux-${ARTIFACT_ARCH}.AppImage"
node ./scripts/verify-update-manifest.mjs "dist/${MANIFEST}" "$APPIMAGE" "$VERSION"
- name: Upload Linux installable artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: desktop-release-smoke-linux-${{ matrix.arch }}
path: |
packages/electron/dist/OpenChamber-${{ steps.versions.outputs.app }}-linux-${{ matrix.artifact_arch }}.AppImage
packages/electron/dist/${{ matrix.manifest }}
if-no-files-found: error
retention-days: ${{ fromJSON(inputs.retention_days) }}