[CI] wheelhouse: add manual workflow_dispatch with force_all input
All checks were successful
wheelhouse / wheelhouse (push) Successful in 19s
All checks were successful
wheelhouse / wheelhouse (push) Successful in 19s
Allows triggering from the Actions tab; force_all=true builds & publishes every addon regardless of the changed-files diff, to seed the registry on the first run. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c15f90b09e
commit
11e7fe721c
1 changed files with 40 additions and 20 deletions
|
|
@ -23,6 +23,15 @@ on:
|
||||||
# All Odoo series branches: 16.0, 17.0, 18.0, ...
|
# All Odoo series branches: 16.0, 17.0, 18.0, ...
|
||||||
# Deliberately excludes 16.0-ocabot-* / feature branches.
|
# Deliberately excludes 16.0-ocabot-* / feature branches.
|
||||||
- "*.0"
|
- "*.0"
|
||||||
|
# Manual trigger (Actions tab -> "Run workflow"). Use force_all=true to
|
||||||
|
# build & publish every addon regardless of the changed-files diff -- handy
|
||||||
|
# for seeding the registry on the very first run.
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
force_all:
|
||||||
|
description: "Build & publish ALL addons (ignore the changed-files diff)"
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
wheelhouse:
|
wheelhouse:
|
||||||
|
|
@ -40,32 +49,43 @@ jobs:
|
||||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||||
|
|
||||||
- name: Determine changed addons
|
- name: Determine addons to build
|
||||||
id: changed
|
id: changed
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
before="${{ github.event.before }}"
|
force="${{ github.event.inputs.force_all || 'false' }}"
|
||||||
# On the first push to a branch (or a force-push), `before` is all
|
|
||||||
# zeros / unreachable; fall back to the parent commit.
|
|
||||||
if [ -z "$before" ] || ! git cat-file -e "${before}^{commit}" 2>/dev/null ; then
|
|
||||||
before="$(git rev-parse HEAD~1 2>/dev/null || true)"
|
|
||||||
fi
|
|
||||||
if [ -n "$before" ]; then
|
|
||||||
changed_files="$(git diff --name-only "$before" HEAD)"
|
|
||||||
else
|
|
||||||
changed_files="$(git ls-files)"
|
|
||||||
fi
|
|
||||||
# Reduce to top-level addon dirs that actually changed and are addons.
|
|
||||||
addons=""
|
addons=""
|
||||||
for addon in */ ; do
|
if [ "$force" = "true" ]; then
|
||||||
name="${addon%/}"
|
# Forced run: build every addon, ignore the diff.
|
||||||
if [ -f "${addon}__manifest__.py" ] && [ -f "${addon}pyproject.toml" ] \
|
for addon in */ ; do
|
||||||
&& echo "$changed_files" | grep -q "^${name}/" ; then
|
name="${addon%/}"
|
||||||
addons="${addons} ${name}"
|
if [ -f "${addon}__manifest__.py" ] && [ -f "${addon}pyproject.toml" ]; then
|
||||||
|
addons="${addons} ${name}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
before="${{ github.event.before }}"
|
||||||
|
# On the first push to a branch (or a force-push), `before` is all
|
||||||
|
# zeros / unreachable; fall back to the parent commit.
|
||||||
|
if [ -z "$before" ] || ! git cat-file -e "${before}^{commit}" 2>/dev/null ; then
|
||||||
|
before="$(git rev-parse HEAD~1 2>/dev/null || true)"
|
||||||
fi
|
fi
|
||||||
done
|
if [ -n "$before" ]; then
|
||||||
|
changed_files="$(git diff --name-only "$before" HEAD)"
|
||||||
|
else
|
||||||
|
changed_files="$(git ls-files)"
|
||||||
|
fi
|
||||||
|
# Reduce to top-level addon dirs that actually changed and are addons.
|
||||||
|
for addon in */ ; do
|
||||||
|
name="${addon%/}"
|
||||||
|
if [ -f "${addon}__manifest__.py" ] && [ -f "${addon}pyproject.toml" ] \
|
||||||
|
&& echo "$changed_files" | grep -q "^${name}/" ; then
|
||||||
|
addons="${addons} ${name}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
addons="$(echo "$addons" | xargs || true)"
|
addons="$(echo "$addons" | xargs || true)"
|
||||||
echo "Changed addons:${addons:- (none)}"
|
echo "Addons to build:${addons:- (none)}"
|
||||||
echo "addons=${addons}" >> "$GITHUB_OUTPUT"
|
echo "addons=${addons}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Build wheels for changed addons
|
- name: Build wheels for changed addons
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue