CI: also build on push to main (code changes), keep cron for new releases
Build and Publish O3DE Flatpak / build (push) Successful in 15m28s
Build and Publish O3DE Flatpak / build (push) Successful in 15m28s
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,22 @@
|
|||||||
name: Build and Publish O3DE Flatpak
|
name: Build and Publish O3DE Flatpak
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
# New O3DE binary release: the daily check rebuilds when upstream's version has
|
||||||
|
# no matching vX.Y.Z tag yet.
|
||||||
schedule:
|
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:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
force:
|
force:
|
||||||
@@ -61,9 +75,11 @@ jobs:
|
|||||||
id: check
|
id: check
|
||||||
run: |
|
run: |
|
||||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
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 "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
|
elif git ls-remote --tags origin "refs/tags/v${{ steps.ver.outputs.version }}" | grep -q .; then
|
||||||
echo "build=false" >> "$GITHUB_OUTPUT"
|
echo "build=false" >> "$GITHUB_OUTPUT"
|
||||||
echo "v${{ steps.ver.outputs.version }} already published - nothing to do."
|
echo "v${{ steps.ver.outputs.version }} already published - nothing to do."
|
||||||
|
|||||||
@@ -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
|
access and add it as a secret named **`PUBLISH_TOKEN`** — the workflow prefers
|
||||||
it automatically.
|
it automatically.
|
||||||
|
|
||||||
Trigger it manually from the Gitea Actions UI (`workflow_dispatch`, with an
|
It runs on three triggers:
|
||||||
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.
|
- **`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.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user