From 50cd93dd92fbb5585d59c7a3390a3204074f8476 Mon Sep 17 00:00:00 2001 From: Hayden Spitzley Date: Tue, 13 Aug 2024 15:30:32 -0600 Subject: [PATCH] chore: bump --- .github/actions/chart-release/action.yaml | 30 +++++++++++------------ .github/workflows/chart-release.yaml | 11 ++++++--- stack/values.yaml | 2 +- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.github/actions/chart-release/action.yaml b/.github/actions/chart-release/action.yaml index 2a99260..9a2d5da 100644 --- a/.github/actions/chart-release/action.yaml +++ b/.github/actions/chart-release/action.yaml @@ -54,36 +54,36 @@ runs: msg = `${msg} (prerelease)`; } return msg; + - name: Merge in main + shell: bash + run: | + git config --global user.email "czihelperbot@chanzuckerberg.com" + git config --global user.name "CZI Argus Helm Publisher Bot" + git pull + git merge origin/main + - name: Patch version + uses: mikefarah/yq@v4 + with: + cmd: yq -i '.version = "${{ inputs.version }}"' ${{ inputs.release_name }}/Chart.yaml - name: Publish charts shell: bash run: | set -ue set -o pipefail - # the location of the chart package - CHARTS_DIR="${{ inputs.release_name }}" - # location of release to download the chart from - CHART_DOWNLOAD_URL="https://github.com/${{ github.repository }}/raw/${{ steps.branch.outputs.result }}" - - git config --global user.email "czihelperbot@chanzuckerberg.com" - git config --global user.name "CZI Argus Helm Publisher Bot" - PACKAGE_DIR="." echo ------ cat ${PACKAGE_DIR}/index.yaml echo ------ - git pull - git merge origin/main - echo ------ - cat ${CHARTS_DIR}/Chart.yaml + cat ${{ inputs.release_name }}/Chart.yaml echo ------ helm dependency update ${{ inputs.release_name }} - helm package ${CHARTS_DIR} -d ${PACKAGE_DIR} - helm repo index ${PACKAGE_DIR} --url ${CHART_DOWNLOAD_URL} --merge ${PACKAGE_DIR}/index.yaml + helm package ${{ inputs.release_name }} -d ${PACKAGE_DIR} + helm repo index ${PACKAGE_DIR} --url "https://github.com/${{ github.repository }}/raw/${{ steps.branch.outputs.result }}" --merge ${PACKAGE_DIR}/index.yaml git add -A - git commit -m "chore: publish charts from ${{ github.repository }} ${{ inputs.version }}" + git commit -m "chore: publish ${{ inputs.release_name }} chart version ${{ inputs.version }} from ${{ github.repository }}" git push diff --git a/.github/workflows/chart-release.yaml b/.github/workflows/chart-release.yaml index f985756..f62ae67 100644 --- a/.github/workflows/chart-release.yaml +++ b/.github/workflows/chart-release.yaml @@ -5,8 +5,8 @@ on: types: [published] concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: check-chart-released: @@ -44,7 +44,12 @@ jobs: uses: actions/github-script@v7 with: result-encoding: string - script: return context.ref.replace('refs/tags/', '') + script: | + if (!context.ref.startsWith('refs/tags/${{ needs.check-chart-released.outputs.release_name }}-v')) { + throw new Error(`Failed to parse version from tag: ${context.ref}`); + } + const version = context.ref.replace('refs/tags/${{ needs.check-chart-released.outputs.release_name }}-v', '') + return version - name: Checkout uses: actions/checkout@v4 - name: Chart Release diff --git a/stack/values.yaml b/stack/values.yaml index dce420b..5bb455c2 100644 --- a/stack/values.yaml +++ b/stack/values.yaml @@ -227,4 +227,4 @@ cronJobs: # tag: "latest" # command: ["command1", "command2"] # args: ["arg1", "arg2"] -# bump6 +# bump7