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 19, 2025
1 parent ec7ae05 commit 545a013
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions .github/workflows/publish-release-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
name: Publish Release Artifacts
on:
release:
types: [published]
types: [ published ]
push:
branches:
- krew-fix
jobs:
publish-artifacts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Artifacts
run: |
echo "Release Tag: ${{ github.event.release.tag_name }}"
./scripts/github/release-artifacts.sh --tag "${{ github.event.release.tag_name }}" --workflow "Release Artifacts" --repo-org "${{ github.repository_owner }}" download
- name: get latest tag
id: get-latest-tag
env:
GITHUB_TOKEN: ${{ secrets.ORG_CI_GITHUB }}
- name: Upload Artifacts
GH_TOKEN: ${{ github.token }}
run: |
repos="mayastor-extensions mayastor-control-plane mayastor"
./scripts/github/release-artifacts.sh --tag "${{ github.event.release.tag_name }}" --repo-org "${{ github.repository_owner }}" --upload "$repos" upload
env:
GITHUB_TOKEN: ${{ secrets.ORG_CI_GITHUB }}
- name: Update krew index
if: "!github.event.release.prerelease"
uses: rajatjindal/[email protected]
export LATEST_TAG=`gh api repos/${{ github.repository_owner }}/mayastor-extensions/releases/latest | jq -r '.tag_name'`
echo "Got the latest tag:$LATEST_TAG"
#echo "event.tag:"${{ github.event.release.tag_name }}
echo "UpdateKrew:"${{ !github.event.release.prerelease && (steps.get-latest-tag.outputs.latestTag == github.event.release.tag_name) }}
echo "latestTag=$LATEST_TAG" >> "$GITHUB_OUTPUT"
# - uses: actions/checkout@v4
# - name: Download Artifacts
# run: |
# echo "Release Tag: ${{ github.event.release.tag_name }}"
# ./scripts/github/release-artifacts.sh --tag "${{ github.event.release.tag_name }}" --workflow "Release Artifacts" --repo-org "${{ github.repository_owner }}" download
# env:
# GITHUB_TOKEN: ${{ secrets.ORG_CI_GITHUB }}
# - name: Upload Artifacts
# run: |
# repos="mayastor-extensions mayastor-control-plane mayastor"
# ./scripts/github/release-artifacts.sh --tag "${{ github.event.release.tag_name }}" --repo-org "${{ github.repository_owner }}" --upload "$repos" upload
# env:
# GITHUB_TOKEN: ${{ secrets.ORG_CI_GITHUB }}
# - name: Update krew index
# if: ${{ !github.event.release.prerelease && (steps.get-latest-tag.outputs.latestTag == github.event.release.tag_name) }}
# uses: rajatjindal/[email protected]

0 comments on commit 545a013

Please sign in to comment.