Skip to content

Commit e32a4cd

Browse files
authored
fix(ci): correct release workflow (#2)
2 parents 7d104d3 + e32c58b commit e32a4cd

2 files changed

Lines changed: 42 additions & 9 deletions

File tree

‎.github/actions/tag.yml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Tag Docker image
2+
description: Tag an existing Docker image on GHCR with an additional tag
3+
4+
inputs:
5+
repo:
6+
description: Repository of the image to tag
7+
default: ghcr.io/${{ github.repository }}
8+
required: false
9+
source:
10+
description: The source tag to use
11+
required: true
12+
target:
13+
description: The target tag to create
14+
required: true
15+
16+
runs:
17+
using: "composite"
18+
steps:
19+
- name: tag
20+
shell: bash
21+
run: docker buildx imagetools create --tag ${{ inputs.repo }}:${{ inputs.target }} ${{ inputs.repo }}:${{ inputs.source }}

‎.github/workflows/release.yml‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66

77
env:
88
UV_VERSION: 0.8.14
9-
GHCR_IMAGE_REPOSITORY: ghcr.io/${{ github.repository }}
109
PLATFORMS: linux/amd64,linux/arm64/v8
1110

1211
jobs:
@@ -28,7 +27,8 @@ jobs:
2827
- variant: trixie
2928
is_default_variant: true
3029
env:
31-
GIT_SHA_TAG: ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ github.sha }}-${{ matrix.python }}-${{ matrix.variant }}
30+
GIT_SHA_TAG: ${{ github.sha }}-${{ matrix.python }}-${{ matrix.variant }}
31+
3232
steps:
3333
- uses: actions/checkout@v4.1.4
3434
- uses: docker/login-action@v3.1.0
@@ -38,16 +38,28 @@ jobs:
3838
password: ${{ secrets.GITHUB_TOKEN }}
3939

4040
- name: tag ${{ matrix.python }}-${{ matrix.variant }}
41-
run: docker buildx imagetools create --tag ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ matrix.python }}-${{ matrix.variant }} $GIT_SHA_TAG
41+
uses: ./.github/actions/tag
42+
with:
43+
source: ${{ env.GIT_SHA_TAG }}
44+
target: ${{ matrix.python }}-${{ matrix.variant }}
4245

4346
- if: matrix.is_default_variant
44-
name: tag for default variant (${{ matrix.python }})
45-
run: docker buildx imagetools create --tag ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ matrix.python }} $GIT_SHA_TAG
47+
name: tag ${{ matrix.python }} (default variant)
48+
uses: ./.github/actions/tag
49+
with:
50+
source: ${{ env.GIT_SHA_TAG }}
51+
target: ${{ matrix.python }}
4652

4753
- if: matrix.is_default_python
48-
name: tag for default python (${{ matrix.variant }})
49-
run: docker buildx imagetools create --tag ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ matrix.variant }} $GIT_SHA_TAG
54+
name: tag ${{ matrix.variant }} (default python)
55+
uses: ./.github/actions/tag
56+
with:
57+
source: ${{ env.GIT_SHA_TAG }}
58+
target: ${{ matrix.variant }}
5059

5160
- if: matrix.is_default_python && matrix.is_default_variant
52-
name: tag for default python and variant (latest)
53-
run: docker buildx imagetools create --tag ${{ env.GHCR_IMAGE_REPOSITORY }}:latest $GIT_SHA_TAG
61+
name: tag latest (default python and variant)
62+
uses: ./.github/actions/tag
63+
with:
64+
source: ${{ env.GIT_SHA_TAG }}
65+
target: latest

0 commit comments

Comments
 (0)