Skip to content

Commit 5a6cbcd

Browse files
committed
Embed ref in every published tag.
1 parent a3397cf commit 5a6cbcd

1 file changed

Lines changed: 29 additions & 26 deletions

File tree

.github/workflows/publish.yml

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ jobs:
7373
tag="$(./scripts/tag-names.sh \
7474
--stellar-cli-version ${{ matrix.stellar_cli_version }} \
7575
--rust-version ${{ matrix.rust_base_key }} \
76-
--platform ${{ matrix.platform }})"
76+
--platform ${{ matrix.platform }} \
77+
--stellar-cli-ref ${{ matrix.stellar_cli_ref }})"
7778
echo "tag=$tag" >> "$GITHUB_OUTPUT"
7879
echo "image=$REGISTRY:$tag" >> "$GITHUB_OUTPUT"
7980
@@ -232,42 +233,40 @@ jobs:
232233
with:
233234
username: ${{ secrets.DOCKERHUB_USERNAME }}
234235
password: ${{ secrets.DOCKERHUB_TOKEN }}
235-
- name: create manifest lists per (cli, rust base) pair
236+
- name: create manifest list per (cli, rust base) pair
236237
run: |
237238
stellar_cli_ref="$(jq -r --arg v "$STELLAR_CLI_VERSION" \
238239
'.stellar_cli_versions[] | select(.version == $v) | .ref' builds.json \
239240
| head -n1)"
240241
test -n "$stellar_cli_ref" \
241242
|| { echo "::error::no stellar_cli_versions entry for $STELLAR_CLI_VERSION"; exit 1; }
242243
while IFS= read -r key; do
244+
list_tag="$(./scripts/tag-names.sh \
245+
--stellar-cli-version "$STELLAR_CLI_VERSION" --rust-version "$key" \
246+
--stellar-cli-ref "$stellar_cli_ref")"
243247
amd64_tag="$(./scripts/tag-names.sh \
244248
--stellar-cli-version "$STELLAR_CLI_VERSION" --rust-version "$key" \
245-
--platform linux/amd64)"
249+
--platform linux/amd64 \
250+
--stellar-cli-ref "$stellar_cli_ref")"
246251
arm64_tag="$(./scripts/tag-names.sh \
247252
--stellar-cli-version "$STELLAR_CLI_VERSION" --rust-version "$key" \
248-
--platform linux/arm64)"
249-
plain_tag="$(./scripts/tag-names.sh \
250-
--stellar-cli-version "$STELLAR_CLI_VERSION" --rust-version "$key")"
251-
hash_tag="$(./scripts/tag-names.sh \
252-
--stellar-cli-version "$STELLAR_CLI_VERSION" --rust-version "$key" \
253+
--platform linux/arm64 \
253254
--stellar-cli-ref "$stellar_cli_ref")"
254-
for list_tag in "$plain_tag" "$hash_tag"; do
255-
if docker buildx imagetools inspect "$REGISTRY:$list_tag" >/dev/null 2>&1; then
256-
echo "::warning::manifest list $REGISTRY:$list_tag already exists; skipping (lists are immutable)"
257-
{
258-
echo "## ⚠️ Manifest list skipped — already published"
259-
echo ""
260-
echo "\`$REGISTRY:$list_tag\` was already in the registry."
261-
} >> "$GITHUB_STEP_SUMMARY"
262-
continue
263-
fi
264-
echo "::group::manifest $REGISTRY:$list_tag"
265-
docker buildx imagetools create \
266-
--tag "$REGISTRY:$list_tag" \
267-
"$REGISTRY:$amd64_tag" \
268-
"$REGISTRY:$arm64_tag"
269-
echo "::endgroup::"
270-
done
255+
if docker buildx imagetools inspect "$REGISTRY:$list_tag" >/dev/null 2>&1; then
256+
echo "::warning::manifest list $REGISTRY:$list_tag already exists; skipping (lists are immutable)"
257+
{
258+
echo "## ⚠️ Manifest list skipped — already published"
259+
echo ""
260+
echo "\`$REGISTRY:$list_tag\` was already in the registry."
261+
} >> "$GITHUB_STEP_SUMMARY"
262+
continue
263+
fi
264+
echo "::group::manifest $REGISTRY:$list_tag"
265+
docker buildx imagetools create \
266+
--tag "$REGISTRY:$list_tag" \
267+
"$REGISTRY:$amd64_tag" \
268+
"$REGISTRY:$arm64_tag"
269+
echo "::endgroup::"
271270
done < <(jq -r --arg v "$STELLAR_CLI_VERSION" '
272271
.stellar_cli_versions[]
273272
| select(.version == $v)
@@ -295,9 +294,13 @@ jobs:
295294
default_rust="$(jq -r --arg v "$STELLAR_CLI_VERSION" \
296295
'.stellar_cli_versions[] | select(.version == $v) | .default_rust' \
297296
builds.json | head -n1)"
297+
stellar_cli_ref="$(jq -r --arg v "$STELLAR_CLI_VERSION" \
298+
'.stellar_cli_versions[] | select(.version == $v) | .ref' builds.json \
299+
| head -n1)"
298300
target_tag="$(./scripts/tag-names.sh \
299301
--stellar-cli-version "$STELLAR_CLI_VERSION" \
300-
--rust-version "$default_rust")"
302+
--rust-version "$default_rust" \
303+
--stellar-cli-ref "$stellar_cli_ref")"
301304
target="$REGISTRY:$target_tag"
302305
303306
echo "::group::alias $REGISTRY:$STELLAR_CLI_VERSION -> $target"

0 commit comments

Comments
 (0)