Skip to content

Commit

Permalink
Update krew-index on release tag
Browse files Browse the repository at this point in the history
Fixes #904

Signed-off-by: Tom Pantelis <[email protected]>
  • Loading branch information
tpantelis authored and skitt committed Jan 31, 2024
1 parent 1de4080 commit af55efd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]

0 comments on commit af55efd

Please sign in to comment.