Files
OpenZen/.github
Shirona1337 4634789ae0 ci(loader): build-loader workflow + git revision stamp + UPX task
GitHub Actions (.github/workflows/build-loader.yml)
  - Runs on every push to master and on workflow_dispatch.
  - windows-2022 runner: setup-java 17 (Temurin), ilammy/msvc-dev-cmd
    for MSVC x64, clones + bootstraps microsoft/vcpkg into the
    workspace, installs UPX via choco, caches Gradle, then runs
    `gradlew --no-daemon clean dll upxCompress` with VCPKG_ROOT and
    OPENZEN_BUILD_REVISION exported.
  - vcpkg's x-gha binary cache is wired in via VCPKG_BINARY_SOURCES +
    ACTIONS_CACHE_URL / ACTIONS_RUNTIME_TOKEN, so the first run pays
    the Qt static-build cost (~30 min - 2 h) and every push after
    that pulls cached qtbase artifacts.
  - Publishes build/dist/OpenZenLoader.exe as the
    OpenZenLoader-<sha> artifact (30 day retention).

Git revision in window title
  - build.gradle: gitShortRevision() prefers OPENZEN_BUILD_REVISION
    from the environment (set by CI) and falls back to
    `git rev-parse --short=7 HEAD` for local builds.
  - configureNative passes -DOPENZEN_BUILD_REVISION=<sha> to CMake
    and logs the resolved value.
  - native/loader/CMakeLists.txt forwards it as a compile definition.
  - MainWindow.buildUi sets the window title to
    "OpenZen Loader (build abc1234)" when the macro is defined, plain
    "OpenZen Loader" otherwise.

UPX compression
  - New upxCompress Gradle task: locates upx on PATH, runs
    `upx --best --lzma` on build/dist/OpenZenLoader.exe and logs the
    before/after size. Skips with a warning (not an error) when upx
    is missing so local builds keep working without it. CI's
    `gradlew clean dll upxCompress` always shrinks the artifact.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 14:50:12 +08:00
..