Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
222 changes: 222 additions & 0 deletions .github/workflows/linux-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
name: Attach Linux installers to existing release

on:
workflow_dispatch:
inputs:
version:
description: Exact stable version of the existing release
required: true
type: string
source_sha:
description: Full lowercase SHA of the release tag, ancestor of main
required: true
type: string

permissions:
contents: read

concurrency:
group: linux-release-attach
cancel-in-progress: false

jobs:
preflight:
name: Validate the existing release and source
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
source_sha: ${{ steps.validate.outputs.sourceSha }}
version: ${{ steps.validate.outputs.version }}
release_id: ${{ steps.validate.outputs.releaseId }}
steps:
- name: Checkout trusted workflow source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.sha }}
fetch-depth: 0
persist-credentials: false

- name: Node 22
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: 22
package-manager-cache: false

- name: Validate release, tag and bundle names
id: validate
env:
RELEASE_VERSION: ${{ inputs.version }}
RELEASE_SOURCE_SHA: ${{ inputs.source_sha }}
GH_TOKEN: ${{ github.token }}
run: |
node --input-type=module <<'NODE'
import { appendFileSync } from 'node:fs';
import { preflightRelease } from './scripts/linux-release-preflight.mjs';
const result = await preflightRelease();
for (const [key, value] of Object.entries(result)) {
appendFileSync(process.env.GITHUB_OUTPUT, key + '=' + value + '\n');
}
NODE

build:
name: Build and verify Linux bundles
needs: preflight
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
timeout-minutes: 90
outputs:
deb_sha256: ${{ steps.fingerprints.outputs.deb_sha256 }}
appimage_sha256: ${{ steps.fingerprints.outputs.appimage_sha256 }}
artifact_id: ${{ steps.bundles.outputs.artifact-id }}
env:
RELEASE_VERSION: ${{ needs.preflight.outputs.version }}
steps:
# `runner` is not allowed in job-level env; derive the path at runtime.
- name: Set bundle directory
run: echo "BUNDLE_DIR=$RUNNER_TEMP/quorb-bundles" >> "$GITHUB_ENV"

- name: Checkout trusted verification tools
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.sha }}
persist-credentials: false

- name: Checkout validated build source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ needs.preflight.outputs.source_sha }}
path: source
persist-credentials: false

- name: Node 22
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: 22
package-manager-cache: false

- name: Rust stable
uses: dtolnay/rust-toolchain@89b12181fb390509a0842a86cc55eeb8eb928c1d
with:
toolchain: stable

- name: Install Tauri 2 Linux system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
curl \
wget \
file \
patchelf \
libwebkit2gtk-4.1-dev \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libsecret-1-dev \
gnome-keyring \
libnotify-dev \
libfuse2 \
xvfb \
dbus \
dbus-x11

- name: Install locked frontend dependencies
working-directory: source
run: npm ci

- name: Build Linux bundles (deb + AppImage)
working-directory: source
run: npm run app:build

- name: Stage exactly the expected bundles
run: |
mkdir -p "$BUNDLE_DIR"
cp "source/src-tauri/target/release/bundle/deb/Quorb_${RELEASE_VERSION}_amd64.deb" "$BUNDLE_DIR/"
cp "source/src-tauri/target/release/bundle/appimage/Quorb_${RELEASE_VERSION}_amd64.AppImage" "$BUNDLE_DIR/"

- name: Launch AppImage directly (FUSE mount path)
run: |
APPIMAGE="$BUNDLE_DIR/Quorb_${RELEASE_VERSION}_amd64.AppImage"
chmod +x "$APPIMAGE"
set +e
timeout -k 10 60 dbus-run-session -- xvfb-run -a "$APPIMAGE" >/tmp/appimage-launch.log 2>&1
code=$?
set -e
if [ "$code" -ne 124 ]; then
echo "AppImage launch failed (code $code)" >&2
tail -40 /tmp/appimage-launch.log >&2
exit 1
fi

- name: Build build-verify image
run: docker build -t quorb-build-verify .testcontainer

- name: Verify bundles in clean Ubuntu 22.04
run: |
test -f "$BUNDLE_DIR/Quorb_${RELEASE_VERSION}_amd64.deb"
test -f "$BUNDLE_DIR/Quorb_${RELEASE_VERSION}_amd64.AppImage"
docker run --rm -v "$BUNDLE_DIR:/artifacts" --platform linux/amd64 quorb-build-verify

- name: Fingerprint verified bundles
id: fingerprints
run: |
deb_hash="$(sha256sum "$BUNDLE_DIR/Quorb_${RELEASE_VERSION}_amd64.deb")"
appimage_hash="$(sha256sum "$BUNDLE_DIR/Quorb_${RELEASE_VERSION}_amd64.AppImage")"
echo "deb_sha256=${deb_hash%% *}" >> "$GITHUB_OUTPUT"
echo "appimage_sha256=${appimage_hash%% *}" >> "$GITHUB_OUTPUT"

- name: Retain verified bundles for this run
id: bundles
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: linux-release-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/quorb-bundles/
if-no-files-found: error
compression-level: 0
retention-days: 14
overwrite: false

attach:
name: Attach verified bundles without overwrite
needs: [preflight, build]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
timeout-minutes: 15
permissions:
contents: write
env:
RELEASE_VERSION: ${{ needs.preflight.outputs.version }}
RELEASE_SOURCE_SHA: ${{ needs.preflight.outputs.source_sha }}
RELEASE_ID: ${{ needs.preflight.outputs.release_id }}
DEB_SHA256: ${{ needs.build.outputs.deb_sha256 }}
APPIMAGE_SHA256: ${{ needs.build.outputs.appimage_sha256 }}
steps:
- name: Checkout trusted publication tools
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.sha }}
fetch-depth: 0
persist-credentials: false

- name: Node 22
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: 22
package-manager-cache: false

- name: Download this run's verified bundles by artifact ID
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
artifact-ids: ${{ needs.build.outputs.artifact_id }}
merge-multiple: true
path: ${{ runner.temp }}/linux-release-verified

- name: Revalidate release and attach only the verified files and checksums
env:
GH_TOKEN: ${{ github.token }}
# `runner` is allowed in step-level env, not in job-level env.
BUNDLE_DIR: ${{ runner.temp }}/linux-release-verified
run: node scripts/linux-release-attach.mjs
21 changes: 21 additions & 0 deletions docs/release-linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Attach Linux installers to an existing release

Run **Actions → Attach Linux installers to existing release** manually from
`main`. Supply the stable `version` without `v` (for example `0.9.0`) and the
full 40-character lowercase `source_sha` of that release's tag. The SHA must
be an ancestor of `origin/main`; the release and its matching tag must already
exist, including for a draft. Manifest versions and the Tauri configuration
must match. No tag or release is created or changed.

The Ubuntu 22.04 build verifies both bundles in a clean container and attaches
only `Quorb_<version>_amd64.deb`, `Quorb_<version>_amd64.AppImage`, and a
`.sha256` file for each. It refuses to overwrite any of these names and checks
again immediately before uploading. On an upload failure it rolls back only
IDs confirmed as uploaded by this run. If an upload response is ambiguous or
rollback fails, inspect the release assets and clean up any reported leftovers
manually before retrying.

Linux updates are manual: download and install a newer release yourself; there
is no Linux entry in `latest.json`. The `.deb` is recommended. The AppImage
requires FUSE (`libfuse2`) and may fail on some desktops even with FUSE
installed.
42 changes: 42 additions & 0 deletions odd/tasks/linux-release-attach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Linux release attach (v0.9.0)

Manual workflow that builds the Linux `.deb` and `.AppImage` from an existing release's exact source commit and attaches them to that release, so v0.9.0 gets an official Linux installer without a new version.
Owner: @egdev6. Branch: `ci/linux-release-attach`. Risk: item 5 (release delivery / CI).

## Specs

- S1. Goal, from the owner: «hay que sacar la 0.10.0 para poder oficializar el instalador de linux? no podemos arreglar lo que queda e inclurlo en la 0.9.0?» → Linux installers are attached to the already published `v0.9.0`; no new version.
- S2. Accepted proposal («haz el workflow»): a new `.github/workflows/linux-release.yml`, following the macOS pattern:
- manual `workflow_dispatch` only, from `main`, with inputs `version` and `source_sha`;
- verifies the release already exists;
- checks out that exact commit;
- builds the `.deb` and `.AppImage` on Ubuntu;
- attaches them to the release without overwriting anything.
- S3. Reuse what already works: the Linux system dependencies, build and clean-container verification steps of `linux-ci.yml` (`Install Tauri 2 Linux system dependencies`, `Build Linux bundles (deb + AppImage)`, `Verify bundles in clean Ubuntu 22.04` / `scripts/verify-linux-bundles`), on `ubuntu-22.04` like `linux-ci.yml`.
- S4. Safety, mirroring `macos-release.yml` / `scripts/macos-release-preflight.mjs` / `scripts/macos-release-resume-publish.mjs`:
- refuse unless `github.ref == refs/heads/main`;
- validate `version` (stable SemVer) and `source_sha` (40 lowercase hex, ancestor of `origin/main`, manifests at that SHA declare `version`) before building;
- the release `v<version>` must already exist (published or draft) and its tag must point to `source_sha`;
- inputs reach shell only through `env`, never interpolated into `run:`;
- actions pinned by full SHA as in the existing workflows; `permissions: contents: read` at workflow level, `contents: write` only in the attach job; no other secrets than `GITHUB_TOKEN`;
- never create or move tags, never edit the release body, never touch `latest.json` or updater files;
- attach only `Quorb_<version>_amd64.deb`, `Quorb_<version>_amd64.AppImage` and one `.sha256` per file; if any of those names already exists on the release, fail without overwriting; on a partial upload failure, delete only the assets this run uploaded.
- S5. Tests in the repo's existing style (`node --test`, like `scripts/macos-release-workflow.test.mjs` and `scripts/macos-release-preflight.test.mjs`): structural workflow assertions (trigger, ref guard, permissions, pinned actions, no input interpolation, attach-only names) and unit tests of the preflight/attach scripts, wired into `npm test`.
- S6. Document how to run it (inputs, what it attaches, manual updates on Linux, AppImage FUSE caveat) in `docs/release-linux.md`.

## Tasks

| ID | Specs | Route | Commit |
| --- | --- | --- | --- |
| T1 | S2–S6 | gentle-ai-worker | c04641a, 5bac5ea, 5bd5fdc |
| T2 | S1–S6 | gentle-ai-verify (Risk: item 5) | fix in this commit |
| T3 | S1 | parent, after the owner runs the workflow: release notes, README Linux row | — |

## Log

- L1 (2026-11-20, owner): «habría que añadir los links de descarga de linux al readme. Puedes hacer que los links descarguen la latest y no haya que cambiarlo manualmente en cada despliegue? Hazte pull antes»
- L2 (owner): «el instalador ya está para linux no? que la descarga apunte a él» — evidence: no release v0.1.1–v0.9.0 has Linux assets; `release.yml` is Windows-only; Linux bundles are private `linux-ci.yml` artifacts.
- L3 (owner): «a ver aclarémonos...hay que sacar la 0.10.0 para poder oficializar el instalador de linux? no podemos arreglar lo que queda e inclurlo en la 0.9.0?»
- L4 (owner): «haz el workflow»
- L5 (verify): S3–S6 pass; B1 blocker: `runner.temp` in job-level `env:` (not allowed by GitHub). `scripts/verify-linux-bundles` does not exist; `.testcontainer` (used by linux-ci) is the equivalent.
- L6 (parent): B1 fixed (build: `$RUNNER_TEMP` via `$GITHUB_ENV`; attach: step-level env, keeping a single `run:`), regression test added (RED then GREEN). Focused 21/21, `npm test` exit 0 (vitest 1241, node 329), actionlint v1.7.7 exit 0. Slices: c04641a (preflight), 5bac5ea (attach), 5bd5fdc (workflow + docs).
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dev": "vite",
"build": "tsc --noEmit && vite build",
"typecheck": "tsc --noEmit",
"test": "vitest run --dir src && node --test scripts/bump.test.mjs scripts/i18n-inventory.test.mjs scripts/release-check.test.mjs scripts/setup-signing.test.mjs scripts/dev-retirement.test.mjs scripts/uninstall.test.mjs scripts/installer-locale.test.mjs scripts/security/check-repository.test.mjs scripts/security/semgrep-report.test.mjs scripts/security/export-snapshot.test.mjs scripts/security/snapshot-report.test.mjs scripts/security/semgrep-entry.test.mjs scripts/security/run-semgrep.test.mjs scripts/security/semgrep-parse-gate.test.mjs scripts/security/provision-tools.test.mjs scripts/security/zizmor-report.test.mjs scripts/security/zizmor-entry.test.mjs scripts/security/run-zizmor.test.mjs scripts/security/provider-logo-regexp.test.mjs scripts/security/code-safety.test.mjs scripts/verify-macos-bundle.test.mjs scripts/macos-ci.test.mjs scripts/macos-preview-policy.test.mjs scripts/macos-preview-preflight.test.mjs scripts/macos-preview-artifact.test.mjs scripts/macos-preview-workflow.test.mjs scripts/updates-section-regression.test.mjs scripts/verify-linux-bundles.test.mjs scripts/macos-release-preflight.test.mjs scripts/macos-release-workflow.test.mjs scripts/macos-notary-workflow.test.mjs scripts/macos-notary-checkpoint.test.mjs scripts/macos-notary-submit.test.mjs scripts/macos-notary-artifact.test.mjs scripts/macos-release-resume.test.mjs scripts/macos-release-resume-workflow.test.mjs scripts/macos-release-resume-publish.test.mjs",
"test": "vitest run --dir src && node --test scripts/bump.test.mjs scripts/i18n-inventory.test.mjs scripts/release-check.test.mjs scripts/setup-signing.test.mjs scripts/dev-retirement.test.mjs scripts/uninstall.test.mjs scripts/installer-locale.test.mjs scripts/security/check-repository.test.mjs scripts/security/semgrep-report.test.mjs scripts/security/export-snapshot.test.mjs scripts/security/snapshot-report.test.mjs scripts/security/semgrep-entry.test.mjs scripts/security/run-semgrep.test.mjs scripts/security/semgrep-parse-gate.test.mjs scripts/security/provision-tools.test.mjs scripts/security/zizmor-report.test.mjs scripts/security/zizmor-entry.test.mjs scripts/security/run-zizmor.test.mjs scripts/security/provider-logo-regexp.test.mjs scripts/security/code-safety.test.mjs scripts/verify-macos-bundle.test.mjs scripts/macos-ci.test.mjs scripts/macos-preview-policy.test.mjs scripts/macos-preview-preflight.test.mjs scripts/macos-preview-artifact.test.mjs scripts/macos-preview-workflow.test.mjs scripts/updates-section-regression.test.mjs scripts/verify-linux-bundles.test.mjs scripts/macos-release-preflight.test.mjs scripts/macos-release-workflow.test.mjs scripts/macos-notary-workflow.test.mjs scripts/macos-notary-checkpoint.test.mjs scripts/macos-notary-submit.test.mjs scripts/macos-notary-artifact.test.mjs scripts/macos-release-resume.test.mjs scripts/macos-release-resume-workflow.test.mjs scripts/macos-release-resume-publish.test.mjs scripts/linux-release-workflow.test.mjs scripts/linux-release-preflight.test.mjs scripts/linux-release-attach.test.mjs",
"tauri": "tauri",
"app:dev": "tauri dev",
"app:build": "tauri build",
Expand Down
Loading
Loading