mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 16:27:37 +01:00
The product, its assistant, the repo, the host and every unit on the box now share one name. 638 files, ~3,000 mentions: UI copy, config, env keys (FLEETCROWN_* -> LOKI_*), systemd units (fleetcrown-* -> loki-*), docs, articles, the deploy workflow other repos reuse, and nine file names. - Three article slugs carried the old name and had been shared; permanent redirects keep those links alive (next.config.ts). - test-no-retired-name.sh now also forbids the old product name across the whole repo, so the rename cannot creep back through templates and examples. - ASSISTANT_STACK collapses the product and the assistant into one entry, because they are now the same name. Infra was cut over ahead of this merge: /opt/loki, loki-* units, the `loki` database and role, loki.orangecat.ch (old host 308s to it; /api, /widget, /embed keep proxying), GitHub repos bitbaum/loki and bitbaum/loki-releases. The Resend sending domain stays fleetcrown.orangecat.ch until the new domain is verified in DNS. Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
213 lines
9.6 KiB
YAML
213 lines
9.6 KiB
YAML
# Fleet Runner desktop release — multi-platform build + GitHub Release.
|
||
#
|
||
# Trigger: pushing a tag matching `fleet-runner-v*` (e.g. fleet-runner-v0.2.0).
|
||
# Output: installers for macOS (.dmg, .zip), Windows (NSIS .exe), and
|
||
# Linux (.AppImage, .deb), published in one public release on
|
||
# bitbaum/loki-releases tagged `fleet-runner-v<version>`.
|
||
#
|
||
# Two jobs, and the split is deliberate:
|
||
#
|
||
# build builds each OS on its own runner and uploads the installers as
|
||
# workflow artifacts. It does NOT publish. electron-builder's GitHub
|
||
# provider can only write to the repo the workflow runs in using the
|
||
# default GITHUB_TOKEN, but `publish` in desktop/package.json points
|
||
# at loki-releases — so letting it publish here fails the whole
|
||
# matrix on an upload 403. That is exactly what silently broke the
|
||
# pipeline after v0.8.6: releases 0.8.7-0.8.9 had to be cut by hand
|
||
# on a Linux box and shipped without macOS or Windows builds at all.
|
||
#
|
||
# mirror collects all three sets of artifacts and publishes them to
|
||
# loki-releases under the `fleet-runner-v*` tag convention that
|
||
# 31 previous releases and the marketing /download URLs already use.
|
||
# Cross-repo writes need a PAT: RELEASES_REPO_TOKEN (repo scope on
|
||
# loki-releases). This replaces the manual post-build run of
|
||
# scripts/mirror-desktop-release.sh, which is the step everyone
|
||
# forgot. The job reuses that same script, so there is one
|
||
# implementation of "how a release is assembled", not two.
|
||
#
|
||
# Why this exists: macOS and Windows users could not download Fleet Runner
|
||
# before — there was only a Linux AppImage produced manually. electron-builder
|
||
# needs to run on the target OS for signed installers, so this workflow uses a
|
||
# build matrix to produce all three from one tag push.
|
||
#
|
||
# Manual run via `workflow_dispatch` is also supported for testing changes to
|
||
# the build pipeline without minting a real version tag: the `mirror` job is
|
||
# gated on the tag ref, so a dispatched run builds all three platforms and
|
||
# publishes nothing. (There is no `dry_run` input any more — it used to gate
|
||
# publishing inside the build job, and publishing no longer happens there.)
|
||
|
||
name: Desktop release
|
||
|
||
on:
|
||
push:
|
||
tags:
|
||
- "fleet-runner-v*"
|
||
workflow_dispatch:
|
||
|
||
concurrency:
|
||
group: desktop-release-${{ github.ref }}
|
||
cancel-in-progress: false
|
||
|
||
# electron-builder's GitHub provider uploads artifacts to releases, which
|
||
# requires the workflow token to have write access to the repo's contents.
|
||
# The default GITHUB_TOKEN permissions are read-only on contents under the
|
||
# new GitHub permissions model.
|
||
permissions:
|
||
contents: write
|
||
|
||
jobs:
|
||
build:
|
||
name: Build (${{ matrix.os }})
|
||
runs-on: ${{ matrix.os }}
|
||
timeout-minutes: 40
|
||
strategy:
|
||
fail-fast: false
|
||
matrix:
|
||
include:
|
||
# *.blockmap is what lets electron-updater fetch only the changed
|
||
# chunks of an installer instead of the whole file. Omitting it is
|
||
# not fatal (the updater falls back to a full download) but every
|
||
# release before v0.8.7 shipped them, so keep parity.
|
||
- os: macos-latest
|
||
dist_script: dist:mac
|
||
artifact_glob: |
|
||
desktop/dist/Fleet-Runner-mac-*.dmg
|
||
desktop/dist/Fleet-Runner-mac-*.dmg.blockmap
|
||
desktop/dist/Fleet-Runner-mac-*.zip
|
||
desktop/dist/Fleet-Runner-mac-*.zip.blockmap
|
||
desktop/dist/latest-mac.yml
|
||
# windows-2022 (not -latest): node-pty is rebuilt from source by
|
||
# @electron/rebuild's node-gyp 9, which can't detect the VS the
|
||
# newer images ship. The image rotated under us after v0.8.0 and
|
||
# every release build since died at "Install desktop deps".
|
||
- os: windows-2022
|
||
dist_script: dist:win
|
||
artifact_glob: |
|
||
desktop/dist/Fleet-Runner-win-*.exe
|
||
desktop/dist/Fleet-Runner-win-*.exe.blockmap
|
||
desktop/dist/latest.yml
|
||
- os: ubuntu-latest
|
||
dist_script: dist:linux
|
||
artifact_glob: |
|
||
desktop/dist/Fleet-Runner-linux-*.AppImage
|
||
desktop/dist/Fleet-Runner-linux-*.deb
|
||
desktop/dist/latest-linux.yml
|
||
|
||
steps:
|
||
- name: Checkout
|
||
uses: actions/checkout@v7
|
||
|
||
- name: Setup Node
|
||
uses: actions/setup-node@v7
|
||
with:
|
||
node-version: 22
|
||
|
||
# node-gyp 9 (via @electron/rebuild) needs Python with distutils —
|
||
# removed in Python 3.12, which macos/ubuntu images now default to.
|
||
# Pin 3.11 so the proven dep set keeps building from source.
|
||
- name: Setup Python 3.11 (node-gyp needs distutils)
|
||
uses: actions/setup-python@v7
|
||
with:
|
||
python-version: "3.11"
|
||
|
||
# Top-level install — the web app's package.json is needed so
|
||
# @home/* + @/* imports in the desktop main process resolve (those
|
||
# aliases reach into ../src and ../home).
|
||
- uses: pnpm/action-setup@v6
|
||
|
||
- name: Install root deps
|
||
run: pnpm install --frozen-lockfile
|
||
|
||
- name: Install desktop deps
|
||
working-directory: desktop
|
||
run: npm ci
|
||
|
||
# electron-vite builds with esbuild, which STRIPS types rather than
|
||
# checking them — so a type error here does not fail the build, it ships
|
||
# a runtime bug inside a signed binary. Nothing else typechecks desktop/
|
||
# (the root `verify` covers src/ and home/ only), so this is the only
|
||
# gate it gets. It was green when added.
|
||
- name: Typecheck
|
||
working-directory: desktop
|
||
run: npm run typecheck
|
||
|
||
# Build only — never publish from here. The `mirror` job below owns
|
||
# publishing, so this step behaves identically for a tag push and a
|
||
# dry run, and there is no token/permission coupling to get wrong.
|
||
- name: Build & package
|
||
working-directory: desktop
|
||
env:
|
||
# ── Code-signing (gated: empty when the secret is unset → unsigned build,
|
||
# exactly as today). electron-builder reads these directly: set CSC_LINK
|
||
# (base64 Developer ID .p12) + CSC_KEY_PASSWORD to sign macOS; WIN_CSC_LINK
|
||
# + WIN_CSC_KEY_PASSWORD for Windows. Notarization also needs the mac.notarize
|
||
# config + entitlements — see docs/development/desktop-signing.md.
|
||
CSC_LINK: ${{ secrets.MAC_CSC_LINK }}
|
||
CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }}
|
||
WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
|
||
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
|
||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
|
||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||
shell: bash
|
||
run: |
|
||
# An unset GitHub secret still DEFINES its env var, as an empty
|
||
# string — and electron-builder tests for presence, not truthiness.
|
||
# So an empty CSC_LINK reads as "sign this build", it resolves ""
|
||
# against projectDir, and the run dies with `⨯ <projectDir> not a
|
||
# file`. The signing block below was added as "gated" on 2026-07-27
|
||
# (#100), but that gate never gated: every macOS build has failed
|
||
# since, which is the other half of why no complete release shipped.
|
||
# Dropping the empties restores the intended behaviour — no
|
||
# certificate configured means an unsigned build, not a broken one.
|
||
for v in CSC_LINK CSC_KEY_PASSWORD WIN_CSC_LINK WIN_CSC_KEY_PASSWORD \
|
||
APPLE_ID APPLE_APP_SPECIFIC_PASSWORD APPLE_TEAM_ID; do
|
||
if [ -z "${!v:-}" ]; then unset "$v"; fi
|
||
done
|
||
npm run ${{ matrix.dist_script }}
|
||
|
||
# These artifacts ARE the release — the mirror job publishes exactly what
|
||
# lands here. `error` (not `warn`) on missing files is the point: a
|
||
# silently empty macOS or Windows artifact is how a release ends up
|
||
# Linux-only, which is the failure this workflow now exists to prevent.
|
||
- name: Upload workflow artifacts
|
||
uses: actions/upload-artifact@v7
|
||
with:
|
||
name: fleet-runner-${{ matrix.os }}
|
||
path: ${{ matrix.artifact_glob }}
|
||
if-no-files-found: error
|
||
retention-days: 14
|
||
|
||
# ---------------------------------------------------------------------------
|
||
# Publish every platform's installers to the public download host, in one
|
||
# release, under the tag convention the marketing URLs already resolve to.
|
||
# Runs only for a real tag push, and only if all three builds succeeded --
|
||
# `needs: build` with the default (non-`always()`) condition guarantees a
|
||
# partial matrix never ships.
|
||
# ---------------------------------------------------------------------------
|
||
mirror:
|
||
name: Publish to loki-releases
|
||
needs: build
|
||
if: startsWith(github.ref, 'refs/tags/fleet-runner-v')
|
||
runs-on: ubuntu-latest
|
||
timeout-minutes: 15
|
||
steps:
|
||
- name: Checkout
|
||
uses: actions/checkout@v7
|
||
|
||
- name: Publish release
|
||
env:
|
||
# Cross-repo write. The default GITHUB_TOKEN cannot do this; without
|
||
# the secret we fail loudly rather than half-publishing.
|
||
GH_TOKEN: ${{ secrets.RELEASES_REPO_TOKEN }}
|
||
run: |
|
||
set -euo pipefail
|
||
if [ -z "${GH_TOKEN:-}" ]; then
|
||
echo "::error::RELEASES_REPO_TOKEN is not set — cannot publish to" \
|
||
"bitbaum/loki-releases. Add a PAT with repo scope."
|
||
exit 1
|
||
fi
|
||
version="${GITHUB_REF_NAME#fleet-runner-v}"
|
||
echo "publishing Fleet Runner v${version} from run ${GITHUB_RUN_ID}"
|
||
scripts/mirror-desktop-release.sh "$version" "$GITHUB_RUN_ID"
|