From aca6e8b0e0f3e6839c4ff6b8cd043f44feab4af8 Mon Sep 17 00:00:00 2001 From: devops-engineer Date: Thu, 7 May 2026 03:08:22 -0700 Subject: [PATCH] chore(ci): adopt .runtime-version push-mode cascade signal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Background: post-2026-05-06 SCM is Gitea, not GitHub. Gitea 1.22.6 has no repository_dispatch / workflow_dispatch trigger API (empirically verified across 6 candidate paths in molecule-core#20 issuecomment-913). The molecule-core/publish-runtime.yml cascade therefore cannot fire templates via curl-dispatch — pivots to push-mode instead. This PR is the consumer side of that pivot: - .runtime-version file at repo root — single line, plain version string. Currently 0.1.129 (latest published as of 2026-05-07). publish-runtime overwrites this on each cascade. - publish-image.yml gains a resolve-version job that reads the file and forwards the value to the reusable build workflow as the third-priority source in the resolution chain. Sequencing context: this PR (and 8 sibling PRs to the other template repos) MUST land before molecule-core#20 v2 is merged. Refs molecule-core#14, molecule-core#20. --- .github/workflows/publish-image.yml | 28 +++++++++++++++++++++++++++- .runtime-version | 1 + 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .runtime-version diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 5ea7d6d..04a3308 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -25,7 +25,33 @@ permissions: packages: write jobs: + # The `.runtime-version` file is the push-mode cascade signal post- + # 2026-05-06: when molecule-core/publish-runtime.yml ships a new + # version to PyPI, it does NOT call repository_dispatch (Gitea 1.22.6 + # has no such endpoint — empirically verified molecule-core#20). + # Instead it git-pushes an updated `.runtime-version` to each template, + # which trips this workflow's `on: push: branches: [main]` trigger. + # This job reads that file and forwards the version to the reusable + # build workflow. + resolve-version: + runs-on: ubuntu-latest + timeout-minutes: 2 + outputs: + version: ${{ steps.read.outputs.version }} + steps: + - uses: actions/checkout@v4 + - id: read + run: | + if [ -f .runtime-version ]; then + v="$(head -n1 .runtime-version | tr -d '[:space:]')" + echo "version=$v" >> "$GITHUB_OUTPUT" + echo "resolved runtime version: $v" + else + echo "no .runtime-version file present — falling through to Dockerfile default" + fi + publish: + needs: resolve-version uses: Molecule-AI/molecule-ci/.github/workflows/publish-template-image.yml@main secrets: inherit with: @@ -33,4 +59,4 @@ jobs: # version PyPI just published. Forwarded as a docker --build-arg # so the cache key changes per-version and pip install resolves # freshly. Empty on push/PR — falls back to requirements.txt pin. - runtime_version: ${{ github.event.client_payload.runtime_version || inputs.runtime_version || '' }} + runtime_version: ${{ github.event.client_payload.runtime_version || inputs.runtime_version || needs.resolve-version.outputs.version || '' }} diff --git a/.runtime-version b/.runtime-version new file mode 100644 index 0000000..aab9b57 --- /dev/null +++ b/.runtime-version @@ -0,0 +1 @@ +0.1.129 -- 2.45.2