ci: push only latest version to krew #24
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
name: Publish Release Artifacts | |
on: | |
release: | |
types: [ published ] | |
push: | |
branches: | |
- krew-fix | |
jobs: | |
publish-artifacts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: get latest tag | |
id: get-latest-tag | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
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 ${{ github.event_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) }} | |
if: ${{ !!(github.event_name == 'push') && (steps.get-latest-tag.outputs.latestTag == 'v2.7.0') }} | |
run: echo "UPDATE" | |
#uses: rajatjindal/[email protected] |