Skip to content

Commit d116235

Browse files
committed
Fix GitHub Actions workflow dependencies and Docker tagging
- Make Publish workflow depend on Tests workflow success instead of duplicating tests - Use PAT_TOKEN instead of GITHUB_TOKEN to enable cascading workflow triggers - Fix Docker metadata to support 4-digit semver tags (v0.5.1.52) - Remove 'v' prefix from Docker tags while keeping it in Git tags - Ensure dev tags only created for branch builds, not tag events - Fix missing tags for Python 3.12 builds This resolves the issue where Docker builds weren't triggered after publish and ensures both Python versions get properly tagged images. Signed-off-by: Phillip Sitbon <phillip.sitbon@gmail.com>
1 parent 1a7b215 commit d116235

File tree

2 files changed

+8
-29
lines changed

2 files changed

+8
-29
lines changed

.github/workflows/docker-publish.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ jobs:
4646
tags: |
4747
type=ref,event=branch,suffix=-dev-py${{ matrix.python-version }}
4848
type=ref,event=pr,suffix=-dev-py${{ matrix.python-version }}
49-
type=semver,pattern={{version}},suffix=-dev-py${{ matrix.python-version }}
50-
type=semver,pattern={{major}}.{{minor}},suffix=-dev-py${{ matrix.python-version }}
51-
type=raw,value=${{ github.ref == 'refs/heads/main' && 'dev' || format('{0}-dev', github.ref_name) }},enable=${{ matrix.python-version == '3.13' }}
49+
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}.{{build}},prefix=,suffix=-dev-py${{ matrix.python-version }}
50+
type=raw,value=${{ github.ref_name == 'main' && 'dev' || format('{0}-dev', github.ref_name) }},enable=${{ matrix.python-version == '3.13' && startsWith(github.ref, 'refs/heads/') }}
5251
5352
- name: Build dev image
5453
uses: docker/build-push-action@v6
@@ -130,8 +129,7 @@ jobs:
130129
tags: |
131130
type=ref,event=branch,suffix=${{ matrix.suffix }}
132131
type=ref,event=pr,suffix=${{ matrix.suffix }}
133-
type=semver,pattern={{version}},suffix=${{ matrix.suffix }}
134-
type=semver,pattern={{major}}.{{minor}},suffix=${{ matrix.suffix }}
132+
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}.{{build}},prefix=,suffix=${{ matrix.suffix }}
135133
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && matrix.target == 'pro' }}
136134
137135
- name: Build and push Docker image

.github/workflows/publish.yml

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,15 @@
11
name: Publish
22

33
on:
4-
push:
4+
workflow_run:
5+
workflows: ["Tests"]
6+
types:
7+
- completed
58
branches: [main]
69

710
jobs:
8-
test:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Checkout code
12-
uses: actions/checkout@v4
13-
14-
- name: Install uv
15-
uses: astral-sh/setup-uv@v6
16-
with:
17-
enable-cache: true
18-
19-
- name: Set up Python
20-
run: uv python install
21-
22-
- name: Install dependencies
23-
run: |
24-
uv sync --all-groups --locked
25-
26-
- name: Run tests
27-
run: |
28-
uv run pytest -v
29-
3011
publish:
31-
needs: test
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
3213
runs-on: ubuntu-latest
3314
environment: publish
3415
permissions:

0 commit comments

Comments
 (0)