diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml new file mode 100644 index 00000000..45d22ec5 --- /dev/null +++ b/.github/workflows/post-release.yml @@ -0,0 +1,30 @@ +--- +name: Post Release + +on: + workflow_dispatch: + push: + tags: + - 'v*.*.*' + +jobs: + update-krew: + name: Update krew-index + if: github.repository_owner == 'submariner-io' + runs-on: ubuntu-latest + steps: + - name: Get the latest release tag + run: | + RELEASE_JSON=$(curl -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "${{ github.api_url }}/repos/submariner-io/releases/releases/latest") + echo "Latest release JSON: $RELEASE_JSON" + echo "LATEST_TAG=$(echo $RELEASE_JSON | jq -r .tag_name)" >> $GITHUB_ENV + - name: Print the latest release tag + run: | + echo "Latest release tag: $LATEST_TAG" + - name: Update new version in krew-index + if: ${{ github.ref_name == env.LATEST_TAG }} + uses: rajatjindal/krew-release-bot@v0.0.46 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f19ce60d..1ff5ff8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,3 @@ jobs: RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} GITHUB_JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs/${{ github.job }} run: make do-release - - - name: Update new version in krew-index - uses: rajatjindal/krew-release-bot@v0.0.46