Skip to content

Commit 590e497

Browse files
author
ejacques
committed
Fix OCI annotations and consolidate release workflow
- Use DOCKER_METADATA_ANNOTATIONS_LEVELS to emit labels as annotations - Merge sign and container-url steps to eliminate duplication
1 parent 600e14a commit 590e497

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
- name: Extract metadata for Docker
4141
id: meta
4242
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
43+
env:
44+
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
4345
with:
4446
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4547
tags: |
@@ -61,12 +63,10 @@ jobs:
6163
annotations: ${{ steps.meta.outputs.annotations }}
6264
platforms: linux/amd64,linux/arm64
6365

64-
- name: Sign Container with Cosign (Key-Pair)
66+
- name: Sign Container and Create container-url.txt
6567
env:
6668
DIGEST: ${{ steps.build.outputs.digest }}
67-
# Lowercase the image name for OCI compliance
6869
IMAGE_REF: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
69-
# COSIGN_PASSWORD defaults to empty if not set
7070
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
7171
run: |
7272
if [ -z "${{ secrets.COSIGN_PRIVATE_KEY }}" ]; then
@@ -80,15 +80,7 @@ jobs:
8080
echo "${{ secrets.COSIGN_PRIVATE_KEY }}" > cosign.key
8181
cosign sign --key cosign.key --yes "$IMAGE"
8282
rm -f cosign.key
83-
84-
- name: Create container-url.txt
85-
env:
86-
DIGEST: ${{ steps.build.outputs.digest }}
87-
IMAGE_REF: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
88-
run: |
89-
# Lowercase and include digest for immutable reference
90-
IMAGE_LOWER=$(echo "${IMAGE_REF}" | tr '[:upper:]' '[:lower:]')
91-
echo "${IMAGE_LOWER}@${DIGEST}" > container-url.txt
83+
echo "${IMAGE}" > container-url.txt
9284
echo "Container URL: $(cat container-url.txt)"
9385
9486
- name: Create GitHub Release

0 commit comments

Comments
 (0)