ci(release): workflow_dispatch only so caches survive across releases

- drop the tag-push trigger: caches saved by tag-scoped runs are visible
  to that tag only (GitHub docs, 'Restrictions for accessing a cache'),
  so every tag build started cold and warmed nobody
- dispatch instead, preferably from the default branch; the tag does not
  need to exist, publish creates it at the built commit; warn when
  dispatching from a non-default branch
- merge check-build into resolve-version (one runner + one checkout
  instead of two)
- merge record-build into publish: save the build-success marker at the
  start of publish
- fix softprops input: overwrite_existing does not exist upstream
  (silently ignored); the valid input is overwrite_files

ci(release): dump jpackage out/err logs when macOS packaging fails

ci(windows): align rust cache save key with restore key (arch + v5)

The save action wrote windows-rust-Windows-v3-<lock> with no arch while
restore fanned out on windows-rust-Windows-<arch>-v4-<lock> — so every
saved entry was unreachable by design. It also made the two matrix legs
race to reserve the same key: ARM won, x64 got 'another job may be
creating this cache'. Save now uses the exact restore key (arch + v5);
restore falls back only to same-arch v5 prefixes to avoid pulling the
stale archless v3 entries into the wrong build.

ci: add temporary cache-inspect workflow

ci(cache): one-shot push trigger so the temp inspector can run from a branch

ci(cache): fix field name in inspector (api uses key)

ci(cache): inspect via exact original path lists, per-OS matrix

ci(cache): save only tools/android/build-jar gradle scopes

Packaging scopes' build trees (1.3-2 GB each, 6 scopes) were ~90% installer
outputs and jlink runtime duplicates that actions/cache negation patterns
are unable to exclude (actions/toolkit#713). Saving ~7 GB per run kept the
repo at the 10 GB cache cap and LRU-evicted build-jar/android/windows-rust
entries within minutes of being saved. Packaging scopes are now
restore-only: they fall back to the build-jar scope via restore-keys, and
their outputs regenerate from the JAR artifact in a couple of minutes.

Also remove the temporary cache-inspect workflow (purpose served).

ci(cache): unify gradle-build path lists so restore-keys cross-hit

Restores differ per path list: actions/cache computes a version stamp from
the path list and only matches restore-keys via a version stamp (hash of
the path list): entries with different path lists are invisible to each
other's restore-keys, even with a shared key prefix. The build-jar scope
kept compose/tmp while the generic list negated it, so the
'-v2-build-jar-' fallback never matched for packaging scopes (measured in
run 39349881796: 'Cache not found' listing the fallback prefix). Drop the
ineffective '!*/compose/tmp' negation (no-op at save time anyway per
actions/toolkit#713) so all non-android scopes share one version stamp;
packaging restores now warm from the build-jar entry.

ci: enable Gradle configuration cache in CI; temporary --profile on Linux packaging

ci: revert configuration cache (script-closure tasks not serializable); keep --profile diagnostic

ci: drop temporary --profile diagnostic (profile captured; deb/rpm identified as the quiet ~45s/~23s hogs)

ci: build the macOS x64 DMG on an Intel runner (macos-26-intel)

macos-latest resolves to an arm64 image, so the 'Intel' matrix job ran on
Apple Silicon and jpackage shipped arm64 binaries under the -intel.dmg
name (v1.2.0-beta18): Intel Macs refuse it with 'this program isn't
supported on this mac'. jpackage cannot cross-build, and the Gradle
daemon JVM criteria (gradle-daemon-jvm.properties) provision the daemon
for the host arch, so every arch decision followed the runner. Pin each
matrix entry to its native runner.

proguard: keep JNA entire API from stripping (native GetStaticMethodID lookups)

jnidispatch resolves com.sun.jna.Native#dispose by name from native code
during initIDs; ProGuard stripped it (not a Java-native method, no Java
references), so every Windows package died at launch with
'Failed to launch JVM':
  UnsatisfiedLinkError: Can't obtain static method dispose
      from class com.sun.jna.Native
      at com.sun.jna.platform.win32.Shell32.<clinit>
Linux/macOS never load Shell32, so only Windows builds were affected
(both x64 and arm64). Also keep classes extending/implementing JNA
(Libraries, Callbacks, Structures are loaded reflectively at runtime).

ci: speed up release builds; desktop/chat and theme updates

Share JVM compile outputs from Build JAR, fix macOS Playwright caching,
cache DMG export, and enable configuration cache on CI. Includes desktop
chrome, attachment preview, system theme, and related shared fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>

ci: drop configuration cache on release (Compose ProGuard incompatible)

Co-authored-by: Cursor <cursoragent@cursor.com>

ci: skip JVM recompile on macOS/Windows when Build JAR artifact is restored

Gradle has no cross-OS execution history for restored classes; gate
compileKotlinJvm, desktop compileKotlin, and generateAppBuildInfo when
FROMCHAT_PREBUILT_JVM is set and outputs are present.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-20 02:01:32 +03:00
Unverified
parent eeadc0c25c
commit ed2eb6a382
28 changed files with 783 additions and 273 deletions
+61 -2
View File
@@ -174,6 +174,7 @@ jobs:
timeout-minutes: 45
env:
FROMCHAT_PREBUILT_PROGUARD: "0"
ORG_GRADLE_PROJECT_org.gradle.workers.max: "4"
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/restore-git-mtimes
@@ -199,6 +200,16 @@ jobs:
path: app/desktop/build/ci/proguard/
if-no-files-found: error
retention-days: 3
- uses: actions/upload-artifact@v5
with:
name: jvm-compile-outputs
path: |
app/shared/build
utils/shared/build
app/desktop/build/classes
app/desktop/build/libs
if-no-files-found: error
retention-days: 3
windows-tools:
name: Windows tools (${{ matrix.label }})
@@ -285,6 +296,7 @@ jobs:
if: needs.check-build.outputs.should_build == 'true'
env:
FROMCHAT_PREBUILT_PROGUARD: "1"
FROMCHAT_PREBUILT_JVM: "1"
strategy:
fail-fast: false
matrix:
@@ -328,6 +340,11 @@ jobs:
with:
name: desktop-proguard
path: app/desktop/build/prebuilt/main-release/proguard
- uses: actions/download-artifact@v5
with:
name: jvm-compile-outputs
path: .
- uses: ./.github/actions/restore-jvm-compile-outputs
# Tooling for this architecture, built natively by the windows-tools matrix leg. The two
# architectures must not share: fromchat-pack selects the embedded payload with
# std::env::consts::ARCH, so an x64 stub on ARM64 reports "x86_64" and finds no x86_64
@@ -369,15 +386,20 @@ jobs:
if: needs.check-build.outputs.should_build == 'true'
env:
FROMCHAT_PREBUILT_PROGUARD: "1"
FROMCHAT_PREBUILT_JVM: "1"
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
label: Apple Silicon
runner: macos-latest
# jpackage cannot cross-build: on an arm64 runner this job silently ships
# arm64 binaries under the -intel.dmg name (beta18 did exactly that).
- arch: x64
label: Intel
runs-on: macos-latest
runner: macos-26-intel
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v5
@@ -402,28 +424,56 @@ jobs:
with:
name: desktop-proguard
path: app/desktop/build/prebuilt/main-release/proguard
- uses: actions/download-artifact@v5
with:
name: jvm-compile-outputs
path: .
- uses: ./.github/actions/restore-jvm-compile-outputs
- name: Cache DMG background tooling
uses: actions/cache@v5
with:
path: |
app/desktop/dmg-background/node_modules
~/.cache/ms-playwright
app/desktop/dmg-background/.playwright-browsers
key: dmg-tools-${{ runner.arch }}-${{ hashFiles('app/desktop/dmg-background/package-lock.json') }}
restore-keys: dmg-tools-${{ runner.arch }}-
- name: Cache DMG export output
uses: actions/cache@v5
with:
path: app/desktop/build/dmg-background/dist
key: dmg-export-${{ runner.arch }}-${{ hashFiles('app/desktop/dmg-background/**', 'app/shared/src/commonMain/composeResources/drawable/logo_square.png') }}
restore-keys: dmg-export-${{ runner.arch }}-
- name: Install macOS packaging tools
env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/app/desktop/dmg-background/.playwright-browsers
run: |
if ! command -v create-dmg >/dev/null 2>&1; then
brew install create-dmg
fi
DMG_DIR="app/desktop/dmg-background"
mkdir -p "$PLAYWRIGHT_BROWSERS_PATH"
if [[ ! -f "$DMG_DIR/node_modules/playwright/package.json" ]]; then
npm --prefix "$DMG_DIR" ci --no-fund --no-audit
fi
npm --prefix "$DMG_DIR" exec playwright install chromium
echo "FROMCHAT_DMG_TOOLS_READY=1" >> "$GITHUB_ENV"
echo "PLAYWRIGHT_BROWSERS_PATH=$PLAYWRIGHT_BROWSERS_PATH" >> "$GITHUB_ENV"
- name: Package macOS ${{ matrix.arch }}
run: |
export FROMCHAT_PACKAGING_JDK="$JAVA_HOME"
./gradlew :app:desktop:packageReleaseMac -PdesktopArch=${{ matrix.arch }} --no-daemon --console=plain
# jpackage only reports its error text in files on the runner surface — surface them.
- name: Dump jpackage logs on failure
if: failure()
run: |
for t in createReleaseDistributable createDmgOther; do
D="app/desktop/build/compose/logs/$t"
[[ -d "$D" ]] || continue
for f in "$D"/*.txt; do
echo "===== $f"
cat "$f"
done
done
- uses: actions/upload-artifact@v5
with:
name: macos-${{ matrix.arch }}
@@ -440,6 +490,7 @@ jobs:
if: needs.check-build.outputs.should_build == 'true'
env:
FROMCHAT_PREBUILT_PROGUARD: "1"
FROMCHAT_PREBUILT_JVM: "1"
strategy:
fail-fast: false
matrix:
@@ -472,6 +523,11 @@ jobs:
with:
name: desktop-proguard
path: app/desktop/build/prebuilt/main-release/proguard
- uses: actions/download-artifact@v5
with:
name: jvm-compile-outputs
path: .
- uses: ./.github/actions/restore-jvm-compile-outputs
- name: Install Linux packaging tools
run: |
sudo apt-get update
@@ -489,6 +545,9 @@ jobs:
run: |
# Keep the jmods-capable JDK the setup action exported; fall back to JAVA_HOME.
export FROMCHAT_PACKAGING_JDK="${FROMCHAT_PACKAGING_JDK:-$JAVA_HOME}"
# packageReleaseDeb/rpm are the slow, quiet parts of this invocation (profiled 2026-10-20:
# ~45s/~23s single-threaded jpackage compression) — candidates for parallel-invocation
# packaging if we ever want to shorten this leg.
./gradlew :app:desktop:packageReleaseLinux -PdesktopArch=${{ matrix.arch }} --no-daemon --console=plain
- uses: actions/upload-artifact@v5
with: