From 4281897422ea815b8aea31f098bcf1a5f28793f7 Mon Sep 17 00:00:00 2001 From: oap75 Date: Tue, 15 Aug 2023 13:42:56 +0300 Subject: [PATCH] fix: oci conditions --- .github/workflows/release.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 39fb24f..8c6445f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -49,11 +49,21 @@ jobs: env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + - name: Check changed version + id: file-changed + run: | + shopt -s nullglob + # Get packed chart file name + PKG_NAME=(.cr-release-packages/*.tgz) + if [ ${#PKG_NAME[@]} -gt 0 ]; then + echo "::set-output name=changed::true" + fi + - name: Push Helm Chart to OCI Registries + if: steps.file-changed.outputs.changed == 'true' run: | + shopt -s nullglob REPO_OWNER=`echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'` - # Get packed chart file name - PKG_NAME=`ls .cr-release-packages/*.tgz` - # pushing chart to OCI registries + PKG_NAME=(.cr-release-packages/*.tgz) helm push ${PKG_NAME} oci://registry-1.docker.io/cartesi helm push ${PKG_NAME} oci://ghcr.io/${REPO_OWNER}/charts