Files
loki/.github/workflows/desktop-release.yml
T
Mao NakamotoandClaude Opus 4.7 3c1f8bf6f5 chore: workflow Node 24 actions + marketing back in sync with shipped mac
Two unrelated cleanups bundled because they're both one-line drift fixes:

1. desktop-release.yml: bump actions/checkout, actions/setup-node, and
   actions/upload-artifact from v4 → v6. Silences the Node.js 20
   deprecation warning that's been showing on every build, ahead of
   GitHub forcing Node 24 on 2026-06-16. Other workflows (audit.yml,
   ci.yml) were already on v6 — desktop-release was the holdout.

2. marketing-content.ts: revert Intel-mac references that accidentally
   landed in 1e96998. The mac binary is still arm64-only — pointing
   users at a Fleet-Runner-mac-x64.dmg URL that doesn't exist would
   404 in their faces. Brought back in sync with what ships.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 15:29:51 +02:00

133 lines
5.1 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), uploaded as assets on a DRAFT GitHub release on
# this repo (maonakamoto/fleetcrown) with electron-builder's default tag
# `v<version>` (no `fleet-runner-` prefix — that's an electron-builder
# limitation, it derives the tag from package.json version).
#
# The canonical public download host is maonakamoto/fleetcrown-releases
# (matching the existing fleet-runner-v* tag convention), which is where the
# marketing /download page's /releases/latest/... URLs resolve. After this
# workflow turns green, run scripts/mirror-desktop-release.sh <version> from
# any machine with `gh` logged in to mirror the draft → public release with
# the correct tag. That step will go away once a cross-repo PAT secret is
# wired in (TODO: `RELEASES_REPO_TOKEN` with repo scope on fleetcrown-
# releases, then swap GITHUB_TOKEN below for it).
#
# 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.
name: Desktop release
on:
push:
tags:
- 'fleet-runner-v*'
workflow_dispatch:
inputs:
dry_run:
description: 'Build only — do not publish to a GitHub Release'
type: boolean
default: true
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:
- os: macos-latest
dist_script: dist:mac
artifact_glob: |
desktop/dist/Fleet-Runner-mac-*.dmg
desktop/dist/Fleet-Runner-mac-*.zip
desktop/dist/latest-mac.yml
- os: windows-latest
dist_script: dist:win
artifact_glob: |
desktop/dist/Fleet-Runner-win-*.exe
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@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 22
# 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).
- name: Install root deps
run: npm ci
- name: Install desktop deps
working-directory: desktop
run: npm ci
# electron-builder is happy to talk to GH Releases via the standard
# GITHUB_TOKEN. For tag pushes we publish; for dry-run (workflow_dispatch)
# we only build so we can sanity-check the matrix without making a Release.
- name: Build & package
working-directory: desktop
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Publish only on a real tag — on workflow_dispatch we leave artifacts
# in dist/ for the upload-artifact step to grab.
PUBLISH_FOR_RELEASE: ${{ startsWith(github.ref, 'refs/tags/fleet-runner-v') && !inputs.dry_run }}
shell: bash
run: |
if [ "$PUBLISH_FOR_RELEASE" = "true" ]; then
# `--publish always` is what tells electron-builder to upload to GH.
# We replace the dist:<os> script's "--publish=never" with always
# for this run only.
npx electron-vite build
case "${{ matrix.os }}" in
macos-latest) npx electron-builder --mac --publish always ;;
windows-latest) npx electron-builder --win --publish always ;;
ubuntu-latest) npx electron-builder --linux --publish always ;;
esac
else
npm run ${{ matrix.dist_script }}
fi
# Always upload the built binaries as workflow artifacts — useful when
# running via workflow_dispatch (no GH Release will exist) and as a
# backup for the tagged release path.
- name: Upload workflow artifacts
uses: actions/upload-artifact@v6
with:
name: fleet-runner-${{ matrix.os }}
path: ${{ matrix.artifact_glob }}
if-no-files-found: warn
retention-days: 14