The first SonarQube Cloud scan reported 57 issues. 45 are fixed in code, the 11 on the saved itch.io test pages leave the scan via .sonarcloud.properties, and css:S8776 (Tailwind's @utility nesting) is a false positive to mark on SonarQube Cloud. Worker: trailing slashes and the gate cookie's padding are trimmed by trimEnd() instead of /\/+$/ (quadratic on the public 404 path); the feed and collection parsers lose their backtracking regexes; compareCodeUnits keeps the code-unit sorts (the rule's localeCompare is locale-dependent); Number.*, DEFAULT_SIZES, crypto.randomUUID; i18n-edit.mjs reads stdin. Pipeline: the NSFW notices are one selector list, either class (the rule's ".a.b" would need both), each tested; plain if-guards; update_info.main returns None; no plain-http adapter; [[ ]] in cf_build_status.sh. Supply chain: requirements*.txt are hash-locked pip-tools compiles of requirements*.in (on Python 3.14, which Dependabot reads from the header), installed with --require-hashes --only-binary :all: in block scalars; npm ci --ignore-scripts in CI and the release builds (verified by manual release runs on all platforms); npm run cf:check. Release 4.4.2: also ships the toolchain upgrade (#149, #154) and Dependabot #141-#148, #150, #152, #153. CLAUDE.md gotchas 40 and 41. [skip-discuss] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
176 lines
6.9 KiB
YAML
176 lines
6.9 KiB
YAML
name: Release desktop installers (Tauri)
|
|
|
|
# Release process (draft-first):
|
|
# 1. push a signed tag vX.Y.Z from main
|
|
# 2. `create-release` makes ONE draft release (generated notes); every build
|
|
# job — here and in release_android.yml — uploads into that draft
|
|
# 3. check the assets, edit the notes, then publish:
|
|
# gh release edit vX.Y.Z --draft=false
|
|
# Publishing fires the Discord / Discussions announcements, so they only
|
|
# go out once installers exist. Never create the release by hand first:
|
|
# tauri-action v1 refuses to upload into a non-draft release.
|
|
# Manual dispatch builds without a release and uploads workflow artifacts.
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
workflow_dispatch:
|
|
|
|
permissions: {}
|
|
|
|
concurrency:
|
|
group: release-desktop-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
create-release:
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
permissions:
|
|
contents: write
|
|
outputs:
|
|
release_id: ${{ steps.draft.outputs.release_id }}
|
|
steps:
|
|
- name: Create (or reuse) the draft release
|
|
id: draft
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
TAG: ${{ github.ref_name }}
|
|
REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
gh release view "$TAG" --repo "$REPO" >/dev/null 2>&1 \
|
|
|| gh release create "$TAG" --repo "$REPO" --draft --verify-tag \
|
|
--title "Free Itch Games $TAG" --generate-notes \
|
|
|| true # release_android.yml may have created it a moment earlier
|
|
IS_DRAFT=$(gh release view "$TAG" --repo "$REPO" --json isDraft -q .isDraft)
|
|
if [ "$IS_DRAFT" != "true" ]; then
|
|
echo "::error::Release $TAG is already published — tauri-action only uploads into drafts."
|
|
exit 1
|
|
fi
|
|
echo "release_id=$(gh release view "$TAG" --repo "$REPO" --json databaseId -q .databaseId)" >> "$GITHUB_OUTPUT"
|
|
|
|
build-tauri:
|
|
needs: create-release
|
|
# Tag builds need the draft; manual dispatch builds without one.
|
|
if: ${{ !cancelled() && (needs.create-release.result == 'success' || needs.create-release.result == 'skipped') }}
|
|
permissions:
|
|
contents: write
|
|
timeout-minutes: 60
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# Apple Silicon — native build on M-series runner.
|
|
- platform: 'macos-latest'
|
|
tauri_target: 'aarch64-apple-darwin'
|
|
arch_label: 'aarch64'
|
|
args: '--target aarch64-apple-darwin'
|
|
# Intel — cross-compile from Apple Silicon runner because GitHub
|
|
# retired `macos-13` from free hosted runners (jobs sit in 'queued'
|
|
# forever and get auto-cancelled). Xcode CLI tools on `macos-latest`
|
|
# ship the x86_64 SDK and rustup adds the target below.
|
|
- platform: 'macos-latest'
|
|
tauri_target: 'x86_64-apple-darwin'
|
|
arch_label: 'x86_64'
|
|
args: '--target x86_64-apple-darwin'
|
|
# Kept on 22.04 on purpose: .deb/AppImage built here run on glibc 2.35+
|
|
# (24.04 would raise the floor to 2.39). 22.04 retires 2027-04.
|
|
- platform: 'ubuntu-22.04'
|
|
tauri_target: ''
|
|
arch_label: ''
|
|
args: ''
|
|
- platform: 'windows-latest'
|
|
tauri_target: ''
|
|
arch_label: ''
|
|
args: ''
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version-file: webapp/.node-version
|
|
# No dependency cache in release builds: a poisoned cache could end
|
|
# up inside signed installers. Releases are rare; take the extra minutes.
|
|
package-manager-cache: false
|
|
|
|
- name: Set up Rust
|
|
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
|
|
with:
|
|
toolchain: stable
|
|
targets: ${{ matrix.tauri_target }}
|
|
|
|
- name: Install Linux deps
|
|
if: matrix.platform == 'ubuntu-22.04'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libwebkit2gtk-4.1-dev \
|
|
libappindicator3-dev \
|
|
librsvg2-dev \
|
|
patchelf \
|
|
build-essential \
|
|
libssl-dev
|
|
|
|
- name: Install npm deps
|
|
working-directory: webapp
|
|
run: npm ci --ignore-scripts
|
|
|
|
- name: Build Tauri app
|
|
uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f # action-v1.0.0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
projectPath: webapp
|
|
releaseId: ${{ needs.create-release.outputs.release_id }}
|
|
uploadWorkflowArtifacts: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
args: ${{ matrix.args }}
|
|
|
|
# Tauri's bundler doesn't ship .pkg natively, so build it ourselves with
|
|
# pkgbuild (preinstalled on macOS runners). Runs even if the DMG step
|
|
# above failed, as long as the .app bundle was produced — which it always
|
|
# is, the failure is at the DMG packaging stage.
|
|
- name: Build .pkg installer (macOS)
|
|
if: ${{ !cancelled() && startsWith(matrix.platform, 'macos') && startsWith(github.ref, 'refs/tags/') }}
|
|
shell: bash
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
TAG: ${{ github.ref_name }}
|
|
REPO: ${{ github.repository }}
|
|
TAURI_TARGET: ${{ matrix.tauri_target }}
|
|
ARCH_LABEL: ${{ matrix.arch_label }}
|
|
run: |
|
|
set -e
|
|
CONF="$GITHUB_WORKSPACE/webapp/src-tauri/tauri.conf.json"
|
|
BUNDLE_DIR="webapp/src-tauri/target/$TAURI_TARGET/release/bundle/macos"
|
|
if [ ! -d "$BUNDLE_DIR" ]; then
|
|
echo "::warning::No macOS bundle directory at $BUNDLE_DIR — skipping pkgbuild."
|
|
exit 0
|
|
fi
|
|
cd "$BUNDLE_DIR"
|
|
APP=$(ls -d *.app 2>/dev/null | head -1 || true)
|
|
if [ -z "$APP" ]; then
|
|
echo "::warning::No .app bundle found — skipping pkgbuild."
|
|
exit 0
|
|
fi
|
|
VERSION=$(node -p "require('$CONF').version")
|
|
# Read the identifier from config so it never drifts from the app's
|
|
# real bundle ID (changed to a hyphen-free, Android-valid value).
|
|
IDENTIFIER=$(node -p "require('$CONF').identifier")
|
|
PKG_NAME="$(basename "$APP" .app)_${VERSION}_${ARCH_LABEL}.pkg"
|
|
pkgbuild \
|
|
--component "$APP" \
|
|
--identifier "$IDENTIFIER" \
|
|
--version "$VERSION" \
|
|
--install-location /Applications \
|
|
"$PKG_NAME"
|
|
ls -la "$PKG_NAME"
|
|
gh release upload "$TAG" "$PKG_NAME" --repo "$REPO" --clobber
|