22 Commits

  • ci(release): drop iOS IPA job and release asset
    Skip Kotlin Native link and unsigned IPA packaging in release builds; publish
    Android, desktop, and Linux artifacts only.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
  • Delete stale workflows
    Signed-off-by: denis0001-dev <denis0001.dev@ya.ru>
  • Release 1.2.0: bump version and stable versionCode for CI
    Set default versionName to 1.2.0 with versionCode 120999 so Android stays
    above 1.2.0-beta builds. Teach set-version to derive stable semver codes
    as digits*1000+999 while keeping prerelease strip behavior.
  • Inject git metadata into AppBuildInfo for About and legal links
    Pass gitCommitSha and gitHubRepository from CI Gradle properties and local
    git remote, generate them in AppBuildInfo, and resolve repo-relative legal
    markdown links to GitHub blob URLs. Extend About with commit and license
    links; keep EN/RU strings in sync.
  • Give iOS release job enough Gradle heap for KMP compile.
    Avoid Java heap space failures during linkReleaseFrameworkIosArm64 on macOS runners.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
  • Fix release CI JVM artifact transfer and iOS SDK naming.
    Tar JVM build outputs for artifact upload, extract before packaging verify, derive iphoneos SDK_NAME from xcrun, and skip appimagetool permission checks on CI.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
  • Fix release iOS CI hang and JVM artifact uploads.
    Build the KMP framework with plain Gradle logs before xcodebuild, skip the Xcode Gradle script phase, and include gitignored build outputs in jvm-compile-outputs artifacts.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
  • Restore release files
    Signed-off-by: denis0001-dev <denis0001.dev@ya.ru>
  • Massive refactor and cleanup
    Signed-off-by: denis0001-dev <denis0001.dev@ya.ru>
    
    Massive refactor and cleanup #2
    
    Signed-off-by: denis0001-dev <denis0001.dev@ya.ru>
    
    Fix iOS build
    
    Signed-off-by: denis0001-dev <denis0001.dev@ya.ru>
    
    Final refactoring
    
    Signed-off-by: denis0001-dev <denis0001.dev@ya.ru>
  • 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>
  • Build native ARM64 Windows installer tooling instead of reusing the x64
    The ARM64 installer still died with "installer has no payload for this CPU
    (x86_64)". Two installers, two architectures, and each needs tooling compiled
    for its own target.
    
    fromchat-pack embeds the app-image payload, and payload.rs selects it with
    std::env::consts::ARCH — the stub's own compile-time architecture, not the
    machine's. The stub is a Windows x64 binary, so on ARM64 it runs emulated,
    reports x86_64, and looks for an x86_64 payload that the ARM-only bundle never
    embeds. The ARM asset was therefore structurally incapable of installing.
    
    So the ARM64 leg now builds its own aarch64-pc-windows-msvc tooling on the ARM
    runner (cargo build --release --workspace with no --target builds for the
    host) instead of downloading the x64 artifact, which is now x64-only.
    ensureWindowsRustBinaries is existence-based and rebuilds when binaries are
    absent, so this leg is self-healing if the explicit build step ever misfires.
    
    The Rust cache key was also arch-blind — windows-rust-${{ runner.os }}-v3-... —
    so an x64 target/ directory could be restored onto the ARM runner and make the
    "binaries ready" check pass with the wrong architecture. It now includes
    ${{ runner.arch }} and is bumped to v4, so the two legs cannot share a cache.
    
    This also reverts the PROCESSOR_ARCHITEW6432 sniffing added in 35492fc: with
    natively compiled stubs it is unnecessary, and it would have been actively
    wrong — an x64 installer running emulated on ARM64 should install the x64
    payload, not be redirected to the arm64 one.
    
    Turn the Windows tooling job into a 2-entry matrix
    
    The ARM64 fix had grown into duplicated, arch-conditional steps inside
    windows-package: rust-toolchain, rust cache, a binary verification loop and a
    build step, all gated on matrix.arch. That is per-architecture data, not control
    flow, so it belongs in a matrix.
    
    windows-common (x64-only) becomes windows-tools, a 2-entry matrix over
    {x64 -> windows-latest -> x86_64-pc-windows-msvc} and
    {arm64 -> windows-11-arm -> aarch64-pc-windows-msvc}. Each leg builds the
    installer tooling natively — cargo has no --target, so it builds for the host —
    and uploads it as windows-rust-tools-<arch>. windows-package then downloads
    that artifact unconditionally again, and its two setup-java-gradle calls
    collapse into one driven by a matrix key.
    
    The ARM leg still needs its own step for the packaging JDK
    (ensure-windows-arm64-jdk.cmd); that one is genuinely arch-specific rather than
    matrix data.
    
    This keeps the invariant that matters: fromchat-pack selects the embedded
    payload with std::env::consts::ARCH, so each architecture's installer must be
    compiled for its own target or it reports the wrong CPU and finds no payload.
  • Fix release ProGuard: Adoptium JDK 25 ships no jmods
    Compose Desktop's AbstractProguardTask builds ProGuard's -libraryjars by
    walking <javaHome>/jmods and nothing else. Adoptium stopped shipping the
    jmods/ directory in JDK 25 archives (verified: 0 jmods entries in both the
    linux/x64 and macOS/aarch64 Temurin 25.0.4.1 tarballs, vs 71 for Temurin
    17), so on the runners the desktop packaging JDK resolves to
    /usr/lib/jvm/temurin-25-jdk-amd64 and ProGuard gets no JDK whatsoever.
    Every class then fails to resolve java.lang.Object — 1.3M
    "can't find superclass or interface java.lang.Object" warnings, followed by
    "Please correct the above warnings first".
    
    This is why the Java 25 toolchain bump broke every release while the
    v1.2.0-beta release on the toolchain 17 build kept working, and why a local
    build with the JetBrains Runtime (which does ship jmods) succeeded while CI
    did not. ProGuard's version was never the cause; 7.10.0 was still kept
    because it is what understands this project's Kotlin 2.4 metadata.
    
    Install Zulu 25 (still ships jmods) in the desktop-proguard job and export
    it as FROMCHAT_PACKAGING_JDK; setup-java runs before Temurin 17 so JAVA_HOME
    stays on 17 for Gradle and the Android build. resolvePackagingJdkHome() now
    warns loudly when the JDK it picks has no jmods/, instead of leaving it to
    ProGuard's wall of warnings.
    
    Use setup-java's `path` output for FROMCHAT_PACKAGING_JDK
    
    setup-java@v5 names the installed JDK's location `path`, not `java-path`
    (the v4 name), so the beta4 run exported an empty value, fell back to the
    jmods-less /usr/lib/jvm/temurin-25-jdk-amd64 and failed with the same
    "can't find superclass or interface java.lang.Object" wall of warnings.
    
    The Gradle-side guard added in b0159eb correctly named the offending JDK
    in the beta4 log, which is what pointed at the empty export.
    
    Give the Linux packaging jobs a jmods-capable JDK too
    
    beta5 proved the ProGuard fix: Build JAR passed in 9m35s, and Windows
    (x64 + ARM) and macOS (arm64 + Intel) all packaged successfully. Only the
    two Linux jobs failed, at :app:desktop:createRuntimeImage — jlink exits 1
    because jlink defaults its --module-path to <javaHome>/jmods, the same
    directory ProGuard needs. So the jmods gap bites twice: ProGuard degrades
    into a wall of warnings, jlink just dies.
    
    macOS/Windows runners happen to resolve a JDK 25 that still ships jmods;
    ubuntu-latest's /usr/lib/jvm only has the jmods-less Temurin 25. Point the
    Linux jobs at Zulu 25 via the setup action's desktop-jdk input, and stop
    the packaging step's `export FROMCHAT_PACKAGING_JDK="$JAVA_HOME"` from
    clobbering it with Temurin 17 (hence ${VAR:-$JAVA_HOME}).
    
    Also widen the Gradle guard to name jlink, since that is what actually
    fails on a jmods-less JDK during packaging.
    
    Fix two Windows ARM64 failures: JDK-8371740 and a needless JDK download
    
    Neither is related to the jmods work; both were visible only on the
    windows-11-arm runner.
    
    1. Gradle hung at build shutdown. The runner's ambient JAVA_HOME is Temurin
       21.0.12 aarch64, and JDK-8371740 — a LinkedTransferQueue race fixed only
       in JDK 26 — makes Gradle on Windows ARM64 hang whenever it runs on JDK
       21+, failing the build after the installer was already written with
       "Timeout waiting for concurrent jobs to complete". Gradle's own repo and
       linroid/Ketch both carry workarounds for this. Pin the Gradle JVM to 17,
       which is what the x64 job already does; Adoptium ships no Windows aarch64
       17, hence the new `java-distribution` input and zulu there. Packaging is
       unaffected: resolvePackagingJdkHome() rejects 17 as too old and falls back
       to the Java 25 toolchain JDK for jpackage.
    
    2. "Ensure ARM64 packaging JDK" stalled for minutes and looked hung. The
       script only scanned C:\Program Files\Eclipse Adoptium, but hosted ARM64
       runners ship their ARM64 Temurin 21 under the hostedtoolcache, so the scan
       missed it and fell through to downloading a ~180 MB JDK via
       Invoke-WebRequest + Expand-Archive. Re-running the job showed it still
       installing 3m24s later. Accept JAVA_HOME when it reports os.arch=aarch64 —
       the script's own comments already call Java 21 good enough as the Gradle
       daemon JVM.
    
    Stop the Gradle build cache from being invalidated on every release
    
    Two independent defects, both found while a release sat at 8.83 GB of the
    10 GB per-repo cache limit with entries being evicted.
    
    1. set-version rewrote build.gradle.kts with sed on every run, and that file
       is hashed into the Gradle build-cache key — so each release produced a
       brand-new key and orphaned the previous one. The repo inventory showed the
       damage: windows-package-x64, macos-x64 and windows-package-arm64 each had
       two ~1.1 GB entries differing only in that hash. build.gradle.kts now reads
       -PversionName/-PversionCode (injected as ORG_GRADLE_PROJECT_* by
       set-version) and keeps its previous values as defaults, so local builds are
       unchanged. Types stay String/Integer for the `as Int`/`as String` consumers
       in app/android and app/shared. Side benefit: hash-release-build-inputs also
       hashes build.gradle.kts, so the "inputs unchanged" marker no longer churns
       per version either.
    
    2. Every desktop scope archived the Android build dirs (never built there)
       plus the final installers, the exported ProGuard jars, the jpackage runtime
       image and the ProGuard temp output — all regenerated for each version, and
       together the bulk of a ~1.7 GB entry. Those paths are now excluded, which
       is what kept the repo over the limit and into eviction (GitHub evicts by
       oldest last-accessed once the limit is hit).
    
    Restore and save path lists stay in sync: actions/cache silently skips the save
    when they differ.
    
    Cross-tag reuse is NOT addressed here and cannot be: per the docs, a run for one
    tag cannot read another tag's cache, and the automatic retry against the default
    branch is a no-op for us because main has no app/desktop module to warm it.
    
    Stage each packaging host's own Skiko/JavaFX natives
    
    The beta7 desktop builds cannot start. Both failures the user reported
    (macOS arm64 and Linux arm64) are the same bug:
    
      ERROR: [Desktop] uncaught on main Failed to loade library
      .../libskiko-macos-arm64.dylib
      Caused by: java.lang.UnsatisfiedLinkError: Can't load library
    
    ProGuard runs once, on ubuntu-latest, and its output is shipped to every
    packaging job. But the Compose desktop runtime classpath is host-specific:
    that single ProGuard run froze in skiko-awt-runtime-linux-x64 and
    javafx-*-27-linux, and nothing for any other target. Inspecting the published
    macOS arm64 DMG confirmed it — 140 jars, the entire ProGuard set, with
    skiko-awt-runtime-linux-x64 as the only Skiko runtime and no
    libskiko-*-arm64 anywhere in the bundle, plus no JavaFX natives either. The
    macOS x64 build is broken the same way; Linux x64 is the only target that
    happened to match, and the Windows installers shipped Linux natives too.
    
    stageCiPrebuiltProguard now also stages the packaging host's own natives
    (skiko-awt-runtime-<os>-<arch>, javafx-*-<os>-<arch>) from its resolved
    runtimeClasspath. Skiko and JavaFX each pick their library by os/arch, so the
    foreign Linux copies stay inert and cost only some bundle size. The task
    fails loudly if a host resolves no natives at all.
    
    Verified locally end-to-end with a prebuilt-ProGuard packaging run:
    Contents/app/libskiko-macos-arm64.dylib (21.3 MB) is now present, which is
    the exact path Skiko failed to load before.
    
    Keep ProGuard's output cached in the one scope that runs it
    
    Follow-up to 0e7b181, which excluded compose/tmp from every desktop scope
    to shrink the cache entries. That was too blunt for the build-jar scope:
    compose/tmp/main-release/proguard holds proguardReleaseJars' *output*, so
    without those jars Gradle can never consider the task up-to-date and
    re-runs its ~8 minutes on every re-run of a tag.
    
    Split the non-android path list in two. build-jar keeps compose/tmp; the
    packaging scopes drop it, because they never run ProGuard — they stage the
    Build JAR artifact's jars instead, so their copy is a redundant 122 MB.
  • Fix macOS DMG Playwright install and rename release CI jobs.
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Cache full Gradle build directories in CI instead of ProGuard export only.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Fix Gradle build cache save races with restore-only on parallel jobs.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Always refresh Gradle caches after build, even on cache hit.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Add Maven Central mirror fallback for CI 403 errors.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Pin git-restore-mtime script to a valid commit SHA.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Fix Gradle and Rust cache save failures on parallel release jobs.
    
    Use scope-specific Gradle cache paths, global release concurrency, Rust v3 key with v1/v2 fallbacks, and ensure Android SDK cache dirs exist before save.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
  • Fix release workflow validation (composite action cache key, dispatch inputs).
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Inline CI setup steps; remove broken composite cargo cache action.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Add minimal workflow dispatch test.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Fix release workflow YAML: replace heredoc that broke parsing.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
  • Add optimized multi-platform release CI/CD pipeline.
    Split Windows builds into shared x64 prep and arch-specific packaging, add comprehensive caching, verification scripts, and a PR smoke workflow.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Fix release-smoke workflow YAML syntax error.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Fix CI smoke test compile scope and PE fixture size.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
  • Fix release CI workflow and add Windows x64 installer build.
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Allow Gradle desktop builds when Android signing keys are absent.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
    
    Speed up Windows x64 CI: beta build, fix MSVC lookup on GHA.
    
    Co-authored-by: Cursor <cursoragent@cursor.com>
  • Windows installer
    Improve the installer, fix context menu on Windows, add CI workflows
  • Add release CI to the default branch
    workflow_dispatch only exposes a workflow in the Actions UI when its
    workflow file exists on the default branch. main had no .github/ at all,
    so the Release workflow could only ever be started by pushing a v* tag
    (or through the API), never from the GitHub interface.
    
    Copy .github/ (release.yml plus the composite actions it uses) from
    feature/desktop.