From 75f92a325786cd1a033511e9af120b05f3b73e2f Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy <132273757+dmitry-ratushnyy@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:00:14 +0100 Subject: [PATCH] Fix published file name (#31) * Fix published artifact filename * Use a better variable name --- .github/workflows/publish.yaml | 5 +++-- .github/workflows/publish_beta.yaml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index d35a741..b2bec9a 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -39,10 +39,11 @@ jobs: password: ${{ secrets.GHCR_TOKEN }} - name: Import and push to GHCR run: | - version=$(yq '(.version)' rockcraft.yaml) + version=$(yq '(.version|split("-"))[0]' rockcraft.yaml) + rock_image_version=$(yq '(.version)' rockcraft.yaml) base=$(yq '(.base|split("@"))[1]' rockcraft.yaml) tag=${version}-${base}_edge sudo skopeo --insecure-policy copy \ - oci-archive:charmed-mongodb_${version}_amd64.rock \ + oci-archive:charmed-mongodb_${rock_image_version}_amd64.rock \ docker-daemon:ghcr.io/canonical/charmed-mongodb:${tag} docker push ghcr.io/canonical/charmed-mongodb:${tag} diff --git a/.github/workflows/publish_beta.yaml b/.github/workflows/publish_beta.yaml index c6e3be8..272daed 100644 --- a/.github/workflows/publish_beta.yaml +++ b/.github/workflows/publish_beta.yaml @@ -36,10 +36,11 @@ jobs: password: ${{ secrets.GHCR_TOKEN }} - name: Import and push to GHCR run: | - version=$(yq '(.version)' rockcraft.yaml) + version=$(yq '(.version|split("-"))[0]' rockcraft.yaml) + rock_image_version=$(yq '(.version)' rockcraft.yaml) base=$(yq '(.base|split("@"))[1]' rockcraft.yaml) tag=${version}-${base}_beta sudo skopeo --insecure-policy copy \ - oci-archive:charmed-mongodb_${version}_amd64.rock \ + oci-archive:charmed-mongodb_${rock_image_version}_amd64.rock \ docker-daemon:ghcr.io/canonical/charmed-mongodb:${tag} docker push ghcr.io/canonical/charmed-mongodb:${tag}