Skip to content

Commit 4f80762

Browse files
Add latest tag to the released FDW images to GHCR
1 parent b7dc535 commit 4f80762

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
- name: Get Release assets
2323
env:
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25-
run: |-
25+
run: |-
2626
gh release download ${{ github.event.inputs.release }} --dir . --repo ${{ github.repository }}
2727
2828
- name: Release assets downloaded
29-
run: |-
29+
run: |-
3030
ls -la .
3131
3232
- name: Sanitize Version
@@ -91,6 +91,7 @@ jobs:
9191
- name: Push to registry
9292
run: |-
9393
REF="$CORE_REPO/$IMAGE_NAME:$VERSION"
94+
LATEST_REF="$CORE_REPO/$IMAGE_NAME:latest"
9495
oras push $REF \
9596
--config config.json:application/vnd.turbot.steampipe.config.v1+json \
9697
--annotation-file annotations.json \
@@ -100,3 +101,14 @@ jobs:
100101
steampipe_postgres_fdw.so.linux_arm64.gz:application/vnd.turbot.steampipe.fdw.linux-arm64.layer.v1+gzip \
101102
steampipe_postgres_fdw.control:application/vnd.turbot.steampipe.fdw.control.layer.v1+text \
102103
steampipe_postgres_fdw--1.0.sql:application/vnd.turbot.steampipe.fdw.sql.layer.v1+text
104+
105+
# tag the image with the GitHub Run ID for traceability
106+
oras tag $REF $GITHUB_RUN_ID
107+
108+
# check if the version is NOT an rc version before tagging as latest
109+
if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
110+
echo "Tagging as latest: $LATEST_REF"
111+
oras tag $REF $LATEST_REF
112+
else
113+
echo "Skipping latest tag for rc version: $VERSION"
114+
fi

0 commit comments

Comments
 (0)