diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 512e57172..ef1e7d1a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -133,26 +133,26 @@ jobs: username: ${{ secrets.DOCKER_HUB_USER }} password: ${{ secrets.DOCKER_HUB_TOKEN }} - - name: Extract new image release version from Chart.yaml - if: github.ref == 'refs/heads/main' + + - name: Extract new app version from Chart.yaml run: | chart_yaml_path="./charts/managed-identity-wallet/Chart.yaml" # Use grep to find the line containing appVersion, awk to split by ":" and cut to remove leading/trailing spaces app_version=$(grep 'appVersion:' "$chart_yaml_path" | awk -F: '{gsub(/^[ \t]+|[ \t]+$/,"", $2); print $2}') - echo "IMAGE_VERSION=$app_version" >> $GITHUB_ENV + echo "RELEASE_VERSION=$app_version" >> $GITHUB_ENV + + - name: Extract new image release version from Chart.yaml + if: github.ref == 'refs/heads/main' + run: | + echo "IMAGE_VERSION={{ env.RELEASE_VERSION }}" >> $GITHUB_ENV echo "LATEST_IMAGE_TAG=latest" >> $GITHUB_ENV - name: Extract new image pre-release version from Chart.yaml if: github.ref != 'refs/heads/main' run: | - chart_yaml_path="./charts/managed-identity-wallet/Chart.yaml" - - # Use grep to find the line containing appVersion, awk to split by ":" and cut to remove leading/trailing spaces - app_version=$(grep 'appVersion:' "$chart_yaml_path" | awk -F: '{gsub(/^[ \t]+|[ \t]+$/,"", $2); print $2}') - - echo "IMAGE_VERSION=$app_version" >> $GITHUB_ENV + echo "IMAGE_VERSION={{ env.RELEASE_VERSION }}" >> $GITHUB_ENV echo "LATEST_IMAGE_TAG=alpha" >> $GITHUB_ENV - name: Push image