-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: push only latest version to krew
Signed-off-by: Tiago Castro <[email protected]>
- Loading branch information
1 parent
9659b34
commit f6a06cd
Showing
1 changed file
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | ||
|
@@ -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] |