Skip to content

Commit bc4f07d

Browse files
committed
fix digest name conflicts
1 parent f82416d commit bc4f07d

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

.github/workflows/_release_docker.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ name: _Release 5 - Publish Docker Images to Docker Hub
22
on:
33
workflow_call:
44
inputs:
5-
python:
6-
type: boolean
7-
required: false
85
base:
96
type: 'string'
7+
image_type:
8+
type: choice
9+
description: The type of image to build
10+
default: 'rust'
11+
options:
12+
- rust
13+
- python
1014

1115
permissions:
1216
contents: read
@@ -33,11 +37,10 @@ jobs:
3337
echo "RAPHTORY_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')" >> $GITHUB_ENV
3438
echo "RUST_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].rust_version')" >> $GITHUB_ENV
3539
36-
- name: Prepare python/rust params
40+
- name: Write dockerfile path
3741
run: |
38-
if [ "${{ inputs.python }}" = "true" ]; then
42+
if [ "${{ inputs.image_type }}" = "python" ]; then
3943
echo "DOCKERFILE_PATH=python.Dockerfile" >> $GITHUB_ENV
40-
echo "EXTRA_TAG=-python" >> $GITHUB_ENV
4144
else
4245
echo "DOCKERFILE_PATH=Dockerfile" >> $GITHUB_ENV
4346
fi
@@ -83,7 +86,7 @@ jobs:
8386
- name: Upload digest
8487
uses: actions/upload-artifact@v4
8588
with:
86-
name: digests-${{ env.PLATFORM_PAIR }}
89+
name: digests-${{ inputs.image_type }}-${{ env.PLATFORM_PAIR }}
8790
path: /tmp/digests/*
8891
if-no-files-found: error
8992
retention-days: 1
@@ -97,7 +100,7 @@ jobs:
97100
uses: actions/download-artifact@v4
98101
with:
99102
path: /tmp/digests
100-
pattern: digests-*
103+
pattern: digests-${{ inputs.image_type }}-*
101104
merge-multiple: true
102105

103106
- name: Login to Docker Hub
@@ -122,6 +125,14 @@ jobs:
122125
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
123126
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
124127
128+
- name: Write docker tag
129+
run: |
130+
if [ "${{ inputs.image_type }}" = "python" ]; then
131+
echo "DOCKER_TAG=${{ steps.meta.outputs.version }}-python" >> $GITHUB_ENV
132+
else
133+
echo "DOCKER_TAG=${{ steps.meta.outputs.version }}" >> $GITHUB_ENV
134+
fi
135+
125136
- name: Inspect image
126137
run: |
127-
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}${{ env.EXTRA_TAG }}
138+
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ env.DOCKER_TAG }}

.github/workflows/manual_release_docker.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ jobs:
1818
secrets: inherit
1919
with:
2020
base: ${{ inputs.base }}
21+
image_type: rust
2122
release-python:
2223
name: Release python docker image
2324
uses: ./.github/workflows/_release_docker.yml
2425
secrets: inherit
2526
with:
2627
base: ${{ inputs.base }}
27-
python: true
28+
image_type: python

.github/workflows/release_auto.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ jobs:
3838
with:
3939
base: ${{ inputs.base }} # TODO: read this from inside the action or delete it
4040
dry_run: ${{ inputs.dry_run == true }} # TODO: read this from inside the action or simply skip at this level
41-
python: false
41+
image_type: rust
4242
secrets: inherit
4343
call-release-docker-workflow-python:
4444
name: Release python docker image
4545
uses: ./.github/workflows/_release_docker.yml
4646
with:
4747
base: ${{ inputs.base }} # TODO: read this from inside the action or delete it
4848
dry_run: ${{ inputs.dry_run == true }} # TODO: read this from inside the action or simply skip at this level
49-
python: true
49+
image_type: python
5050
secrets: inherit

0 commit comments

Comments
 (0)