From 6ffcdf2b8e44309cc69ecbe22a9747ad93583514 Mon Sep 17 00:00:00 2001 From: Andrei Pohilko Date: Wed, 1 Feb 2023 09:58:26 +0000 Subject: [PATCH] Commit plugin.yaml update upon release --- .github/workflows/release.yaml | 11 +---------- ci/bump-versions.sh | 3 ++- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index df83219..c7b24bc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,26 +18,16 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Get plugin version - id: get_plugin_version - run: echo "PLUGIN_VERSION=$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)" >> $GITHUB_OUTPUT - name: Get tag name id: get_tag_name run: echo "TAG_NAME=$(echo ${{ github.ref_name }} | cut -d 'v' -f2)" >> $GITHUB_OUTPUT outputs: - plugin_version: ${{ steps.get_plugin_version.outputs.PLUGIN_VERSION }} release_tag: ${{ steps.get_tag_name.outputs.TAG_NAME }} release: needs: pre_release runs-on: ubuntu-latest steps: - - name: Plugin version/Tag name Check - if: needs.pre_release.outputs.release_tag != needs.pre_release.outputs.plugin_version - uses: actions/github-script@v3 - with: - script: | - core.setFailed('Plugin version and tag name are not equivalent!') - name: Checkout uses: actions/checkout@v3 with: @@ -106,6 +96,7 @@ jobs: git checkout main sh ./ci/bump-versions.sh git add charts/helm-dashboard/Chart.yaml + git add plugin.yaml git commit -m "Increment chart versions [skip ci]" || echo "Already up-to-date" git push -f || echo "Nothing to push!" env: diff --git a/ci/bump-versions.sh b/ci/bump-versions.sh index f41423f..00dc64a 100755 --- a/ci/bump-versions.sh +++ b/ci/bump-versions.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e WORKING_DIRECTORY="$PWD" @@ -9,6 +9,7 @@ WORKING_DIRECTORY="$PWD" } sed -i -e "s/appVersion.*/appVersion: \"${APP_VERSION}\" /g" ${HELM_CHARTS_SOURCE}/Chart.yaml +sed -i -e "s/version.*/version: \"${APP_VERSION}\" /g" plugin.yaml CURRENT_VERSION=$(cat ${HELM_CHARTS_SOURCE}/Chart.yaml | grep 'version:' | awk '{print $2}') NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g') sed -i -e "s/${CURRENT_VERSION}/${NEW_VERSION}/g" ${HELM_CHARTS_SOURCE}/Chart.yaml