Skip to content

Commit

Permalink
ci: push only latest version to krew
Browse files Browse the repository at this point in the history
Signed-off-by: Tiago Castro <[email protected]>
  • Loading branch information
tiagolobocastro committed Feb 20, 2025
1 parent 9659b34 commit f6a06cd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/publish-release-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
name: Publish Release Artifacts
on:
release:
types: [published]
types: [ published ]

jobs:
publish-artifacts:
runs-on: ubuntu-latest
steps:
- name: Get Latest Release Tag
id: latest-release
env:
GH_TOKEN: ${{ github.token }}
run: |
LATEST_VERSION=$(gh api repos/${{ github.repository_owner }}/mayastor-extensions/releases/latest | jq -r '.tag_name')
echo "Latest published version:$LATEST_VERSION"
echo "ShouldUpdateKrew:"${{ !github.event.release.prerelease && (steps.latest-release.outputs.latestTag == github.event.release.tag_name) }}
echo "latestTag=$LATEST_VERSION" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
- name: Download Artifacts
run: |
Expand All @@ -20,5 +30,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.ORG_CI_GITHUB }}
- name: Update krew index
if: "!github.event.release.prerelease"
if: ${{ !github.event.release.prerelease && (steps.latest-release.outputs.latestTag == github.event.release.tag_name) }}
uses: rajatjindal/[email protected]

0 comments on commit f6a06cd

Please sign in to comment.