From 1f437d9e11422c7f003361029181368ee6d0d225 Mon Sep 17 00:00:00 2001
From: Chevdor <chevdor@users.noreply.github.com>
Date: Mon, 14 Aug 2023 12:00:24 +0200
Subject: [PATCH] RC container image fixes (#7607)

* Remove ENV for the artifacts folder
---
 .../workflows/release-40_publish-rc-image.yml        | 12 ++++++------
 polkadot/scripts/ci/common/lib.sh                    |  6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/polkadot/.github/workflows/release-40_publish-rc-image.yml b/polkadot/.github/workflows/release-40_publish-rc-image.yml
index a821eaa033f..c46bf534b06 100644
--- a/polkadot/.github/workflows/release-40_publish-rc-image.yml
+++ b/polkadot/.github/workflows/release-40_publish-rc-image.yml
@@ -31,7 +31,6 @@ env:
   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   DOCKER_OWNER: ${{ inputs.owner || github.repository_owner }}
   REPO: ${{ github.repository }}
-  ARTIFACT_FOLDER: release-artifacts
 
 jobs:
   fetch-artifacts:
@@ -51,7 +50,7 @@ jobs:
         with:
           key: artifacts-${{ github.sha }}
           path: |
-            ${ARTIFACT_FOLDER}/**/*
+            ./release-artifacts/**/*
 
   build-container:
     runs-on: ubuntu-latest
@@ -69,11 +68,12 @@ jobs:
         uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
         with:
           key: artifacts-${{ github.sha }}
+          fail-on-cache-miss: true
           path: |
-            ${ARTIFACT_FOLDER}/**/*
+            ./release-artifacts/**/*
 
       - name: Check sha256 ${{ matrix.binary }}
-        working-directory: ${ARTIFACT_FOLDER}
+        working-directory: ./release-artifacts
         run: |
           . ../scripts/ci/common/lib.sh
 
@@ -81,7 +81,7 @@ jobs:
           check_sha256 ${{ matrix.binary }} && echo "OK" || echo "ERR"
 
       - name: Check GPG ${{ matrix.binary }}
-        working-directory: ${ARTIFACT_FOLDER}
+        working-directory: ./release-artifacts
         run: |
           . ../scripts/ci/common/lib.sh
           import_gpg_keys
@@ -102,7 +102,7 @@ jobs:
 
       - name: Build Injected Container image for ${{ matrix.binary }}
         env:
-            BIN_FOLDER: ${ARTIFACT_FOLDER}
+            BIN_FOLDER: ./release-artifacts
             BINARY: ${{ matrix.binary }}
             TAGS: ${{join(steps.fetch_refs.outputs.*, ',')}}
         run: |
diff --git a/polkadot/scripts/ci/common/lib.sh b/polkadot/scripts/ci/common/lib.sh
index 00abe9a1d8d..a04dc2ef1da 100755
--- a/polkadot/scripts/ci/common/lib.sh
+++ b/polkadot/scripts/ci/common/lib.sh
@@ -201,7 +201,6 @@ check_bootnode(){
 fetch_release_artifacts() {
   echo "Release ID : $RELEASE_ID"
   echo "Repo       : $REPO"
-  echo "ARTIFACT_FOLDER: $ARTIFACT_FOLDER"
 
   curl -L -s \
     -H "Accept: application/vnd.github+json" \
@@ -214,8 +213,8 @@ fetch_release_artifacts() {
   count=$(jq '.assets|length' < release.json )
 
   # Fetch artifacts
-  mkdir -p ${ARTIFACT_FOLDER}
-  pushd ${ARTIFACT_FOLDER} > /dev/null
+  mkdir -p "./release-artifacts"
+  pushd "./release-artifacts" > /dev/null
 
   iter=1
   for id in "${ids[@]}"
@@ -227,6 +226,7 @@ fetch_release_artifacts() {
       iter=$((iter + 1))
   done
 
+  pwd
   ls -al --color
   popd > /dev/null
 }
-- 
GitLab