diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c2658b5..520d532 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -340,7 +340,7 @@ jobs: path: dist-macos/Asteria.dmg retention-days: 1 - name: Attach DMG if master release already exists - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + if: ${{ (github.ref == 'refs/heads/master' || github.ref_name == 'master') && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.rebuild_images)) }} continue-on-error: true env: BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }} @@ -350,7 +350,7 @@ jobs: # ── Publish Gitea Release, attach binaries, and bump VERSION (master only) ─── release: - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + if: ${{ success() && (github.ref == 'refs/heads/master' || github.ref_name == 'master') && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.rebuild_images)) }} needs: - package-linux - package-linux-arm64 diff --git a/AGENTS.md b/AGENTS.md index 7eb735c..ae35bfa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -162,7 +162,7 @@ scripts/start-runner-macos.sh - **On feature branches**: Outputs a SemVer 2.0.0 pre-release string `MAJOR.MINOR.PATCH-.` (e.g., `0.1.2-fix-epub.62c08ac`). - **Build & Metadata Propagation**: `CMakeLists.txt` resolves `ASTERIA_VERSION` (or accepts `-DASTERIA_VERSION=...`), populates `PROJECT_VERSION`, `ASTERIA_VERSION_STRING`, `QApplication::applicationVersion()`, `AppInfo.version`, macOS bundle `Info.plist` (`CFBundleShortVersionString` / `CFBundleVersion`), and Windows `VS_VERSION_INFO` via `src/asteria.rc.in`. - **CI Isolation, Gitea Releases & Auto-Bump (`.gitea/workflows/ci.yml`, `scripts/bump-version.sh`)**: - - `release` runs strictly on `push` to `master` (never on PRs or feature branches), using the `BUILD_TOKEN` org secret (`write:repository`, `write:package`). + - `release` runs strictly on `master` (`push` or manual `workflow_dispatch` with `rebuild_images=false`, never on PRs or feature branches), using the `BUILD_TOKEN` org secret (`write:repository`, `write:package`). - At the end of a successful `master` pipeline, `release` runs `scripts/bump-version.sh --assets-dir dist`: 1. Creates release tag `vX.Y.Z` and a Gitea Release at `GITHUB_SHA` via `/api/v1/repos/Asteria/asteria-qt/releases` (if absent). 2. Uploads packaged binaries (`Asteria-x86_64.AppImage.tar.gz`, `Asteria-arm64.AppImage.tar.gz`, `asteria-qt-windows-x86_64.zip`, `asteria-qt-windows-arm64.zip`, and `Asteria.dmg` when the optional `macos-qt` runner is active) as release assets.