Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update krew-index on release tag #911

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
Loading