From 2144e11ac35db3dbfda83b1d06489ecc41ace7e1 Mon Sep 17 00:00:00 2001 From: pc-heini Date: Tue, 16 Jun 2026 03:55:27 +0200 Subject: [PATCH] CI: also build on push to main (code changes), keep cron for new releases - push to main triggers a rebuild of the current version so build changes get tested; scoped to main so the job's pages/tag pushes can't loop it, and docs-only paths are ignored to avoid wasteful full rebuilds. - the decide step treats a push (like a manual force) as build=true even when the version tag already exists. - cron still handles new upstream binary releases as before. Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/build-flatpak.yml | 22 +++++++++++++++++++--- README.md | 13 ++++++++++--- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build-flatpak.yml b/.gitea/workflows/build-flatpak.yml index 36c1af6b..4aa80b90 100644 --- a/.gitea/workflows/build-flatpak.yml +++ b/.gitea/workflows/build-flatpak.yml @@ -1,8 +1,22 @@ name: Build and Publish O3DE Flatpak on: + # New O3DE binary release: the daily check rebuilds when upstream's version has + # no matching vX.Y.Z tag yet. schedule: - - cron: '0 2 * * *' # daily at 02:00 - checks for a new O3DE release + - cron: '0 2 * * *' # daily at 02:00 + # Code change: rebuild whenever the build itself changes. Scoped to `main` on + # purpose - the job force-pushes the `pages` branch and creates tags, and those + # must NOT re-trigger it (that would loop). Docs-only changes are ignored so a + # README/typo edit doesn't kick off a ~15-min, multi-GB build. + push: + branches: + - main + paths-ignore: + - 'README.md' + - 'docs/**' + - 'LICENSE*' + - '.gitignore' workflow_dispatch: inputs: force: @@ -61,9 +75,11 @@ jobs: id: check run: | git config --global --add safe.directory "$GITHUB_WORKSPACE" - if [ "${{ inputs.force }}" = "true" ]; then + # A code push (or a manual force) rebuilds even if this version is already + # published - the point is to test the changed build against it. + if [ "${{ inputs.force }}" = "true" ] || [ "${{ github.event_name }}" = "push" ]; then echo "build=true" >> "$GITHUB_OUTPUT" - echo "Force build requested." + echo "Rebuild requested (${{ github.event_name }})." elif git ls-remote --tags origin "refs/tags/v${{ steps.ver.outputs.version }}" | grep -q .; then echo "build=false" >> "$GITHUB_OUTPUT" echo "v${{ steps.ver.outputs.version }} already published - nothing to do." diff --git a/README.md b/README.md index 65e53abc..d395a248 100644 --- a/README.md +++ b/README.md @@ -85,9 +85,16 @@ The workflow targets a **self-hosted `act_runner`**. Because O3DE is large: access and add it as a secret named **`PUBLISH_TOKEN`** — the workflow prefers it automatically. -Trigger it manually from the Gitea Actions UI (`workflow_dispatch`, with an -optional **force** rebuild), or let the daily `cron` run it. It only rebuilds when -the upstream version has no matching `vX.Y.Z` tag yet, so reruns are cheap no-ops. +It runs on three triggers: + +- **`push` to `main`** — rebuilds whenever the build itself changes (always builds, + even for an already-published version, so you can test your change). Docs-only + changes (`README.md`, `docs/**`, `LICENSE*`, `.gitignore`) are ignored. Scoped to + `main` so the `pages`/tag pushes the job makes don't re-trigger it. +- **daily `cron`** — picks up a **new O3DE binary release**; only builds when the + upstream version has no matching `vX.Y.Z` tag yet, so most days are cheap no-ops. +- **`workflow_dispatch`** — manual run from the Gitea Actions UI, with an optional + **force** rebuild. ---