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
|
||||
|
||||
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."
|
||||
|
||||
Reference in New Issue
Block a user