Skip to content

Commit fb0a3d6

Browse files
committed
Dispatch docker's release-tag.yml (not build-push.yml) after tests (ci#366)
Completes ci#365 by fixing the tag-creation gap #438 left open. Previous shape (#438): docker-dispatch job fired `gh workflow run build-push.yml` + build-push-windows.yml on metanorma-docker main. build-push builds off main, which reads docker's own latest tag — rebuilding the LAST cli version, not the newly-released one. Every fortnight required manual `gh workflow run release-tag.yml` to create the matching docker tag; automation did not close that loop. This PR: docker-dispatch now fires `repository_dispatch: [metanorma/metanorma-cli]` at metanorma-docker's release-tag.yml (which already exposed that listener but nothing dispatched to it). release-tag.yml parses the cli version from client_payload.ref, updates VERSION.mak + Gemfile, creates the matching vX.Y.Z tag, and the tag push triggers build-push + build-push-windows AT the tag with the correct version. After merge: next cli tag push → rake tests → tests-passed → release-tag creates docker tag → docker images build at correct version. Zero manual intervention across the cli → docker chain. Closes #366 on metanorma/ci.
1 parent a5ed55b commit fb0a3d6

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

.github/workflows/rake.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,25 @@ jobs:
1919
pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
2020

2121
# Docker rebuild gated on tests-passed. Fires only after the rake test
22-
# suite has gone green on a tag push. Fixes metanorma/ci#365: docker was
23-
# previously triggered off `release: published` in ruby-artifacts.yml
24-
# with no test-status check, shipping untested images to docker users
25-
# (the least-technical audience in the metanorma distribution — those
26-
# who run the image because they cannot recompile the cli stack).
22+
# suite has gone green on a tag push. Fixes metanorma/ci#365 (test
23+
# gating for the docker chain) + metanorma/ci#366 (reconciliation onto
24+
# release-tag.yml so docker's tag actually corresponds to the released
25+
# cli version).
2726
#
28-
# Dispatches match the ones ruby-artifacts.yml formerly fired on
29-
# release:published — `gh workflow run build-push.yml` + windows variant
30-
# on metanorma-docker main. The ruby-artifacts.yml docker step is now
31-
# gated to workflow_dispatch only (the deliberate manual escape hatch).
27+
# Dispatches metanorma-docker's release-tag.yml via
28+
# `repository_dispatch: [metanorma/metanorma-cli]` — the listener that
29+
# workflow already exposes but that nothing else dispatches to.
30+
# release-tag.yml parses the cli version from client_payload.ref,
31+
# updates VERSION.mak + Gemfile, creates the matching `vX.Y.Z` tag on
32+
# metanorma-docker, and the tag push then triggers build-push +
33+
# build-push-windows AT the tag with the correct version.
3234
#
33-
# Longer-term reconciliation onto metanorma-docker's unused
34-
# release-tag.yml `repository_dispatch: [metanorma/metanorma-cli]`
35-
# listener is a follow-up; this fix stays cli-side only, no
36-
# docker-side changes required.
35+
# Replaces the previous shape (metanorma-cli#438) which dispatched
36+
# build-push.yml + build-push-windows.yml directly on metanorma-docker
37+
# main. That built the LAST tagged version, not the newly-released cli
38+
# version, and required manual `gh workflow run release-tag.yml` every
39+
# fortnight to create the matching docker tag. This dispatch does that
40+
# automatically per release.
3741
docker-dispatch:
3842
needs: rake
3943
if: |
@@ -43,18 +47,14 @@ jobs:
4347
permissions:
4448
contents: read
4549
steps:
46-
- name: Dispatch docker builds (tests-passed gate)
50+
- name: Dispatch metanorma-docker release-tag (tests-passed gate)
4751
env:
4852
GH_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
4953
run: |
50-
echo "Rake passed on ${{ github.ref_name }}; dispatching docker builds"
54+
echo "Rake passed on ${{ github.ref_name }}; dispatching metanorma-docker release-tag"
5155
52-
gh workflow run build-push.yml \
53-
--repo metanorma/metanorma-docker \
54-
--ref main
56+
gh api repos/metanorma/metanorma-docker/dispatches \
57+
-f event_type=metanorma/metanorma-cli \
58+
-f "client_payload[ref]=${{ github.ref }}"
5559
56-
gh workflow run build-push-windows.yml \
57-
--repo metanorma/metanorma-docker \
58-
--ref main
59-
60-
echo "Docker dispatches sent"
60+
echo "release-tag.yml dispatch sent for ${{ github.ref_name }}"

0 commit comments

Comments
 (0)