diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0ec4375..0483ddd 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -11,6 +11,13 @@ on: pull_request: +# Runs of one event and branch or tag never overlap, so an older master run +# cannot finish last and move floating tags back. A newer pending run of the +# same event replaces an older one; other events never replace each other. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: false + env: PYTHON315: '3.15.2' PYTHON314: '3.14.10' @@ -89,13 +96,9 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Push architecture image if: github.event_name == 'push' - env: - PYTHON_VER: ${{ matrix.python.version }} - ARCH: ${{ matrix.arch }} - PYTHON_DEV: ${{ matrix.dev }} - WODBY_USER_ID: ${{ matrix.user_id }} - WODBY_GROUP_ID: ${{ matrix.group_id }} - run: make push + uses: wodby/images/.github/actions/arch-image-push@2da5f02ec3dffc5cb3331152e01e3c89874b0bfe + with: + image: ${{ steps.build-image.outputs.image }} push: if: github.event_name == 'push' @@ -122,6 +125,7 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - uses: wodby/images/.github/actions/arch-image-pins@2da5f02ec3dffc5cb3331152e01e3c89874b0bfe - uses: ./.github/actions with: version: ${{ matrix.python.version }} diff --git a/Makefile b/Makefile index d965f11..26e2bd8 100644 --- a/Makefile +++ b/Makefile @@ -79,10 +79,15 @@ buildx-push: --build-arg WODBY_GROUP_ID=$(WODBY_GROUP_ID) \ ./ +# CI combines the exact architecture images this workflow run pushed; see +# wodby/images arch-image-pins. Per-architecture tags are shared by every run, +# so an overlapping run may already have replaced one of them. +arch-image = $(if $(ARCH_IMAGE_PINS),$(or $(shell cat '$(ARCH_IMAGE_PINS)/$(subst :,_,$(subst /,_,$(1)))' 2>/dev/null),$(error No digest of $(1) was pushed by this workflow run)),$(1)) + buildx-imagetools-create: docker buildx imagetools create -t $(REPO):$(IMAGETOOLS_TAG) \ - $(REPO):$(TAG)-amd64 \ - $(REPO):$(TAG)-arm64 + $(call arch-image,$(REPO):$(TAG)-amd64) \ + $(call arch-image,$(REPO):$(TAG)-arm64) .PHONY: buildx-imagetools-create test: