Skip to content

v0.0.4

v0.0.4 #34

Workflow file for this run

---
name: Release
permissions:
contents: write
packages: write
on:
release:
types:
- published
jobs:
release:
name: release binaries
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
name: Checkout repository
- uses: actions/setup-go@v4
name: Setup go environment
with:
go-version: "1.20"
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
install-only: true
- name: Build libraries
run: |
./build.sh
- name: Get latest release tag
run: |
repo_user=$(echo ${{ github.repository }} | cut -d'/' -f1 | tr '[:upper:]' '[:lower:]')
repo_name=$(echo ${{ github.repository }} | cut -d'/' -f2 | tr '[:upper:]' '[:lower:]')
release_url="https://api.github.com/repos/$repo_user/$repo_name/releases/latest"
release_tag=$(curl -sH "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$release_url" | jq -r ".tag_name")
if [[ -z "$release_tag" ]]; then echo "variable release_tag is empty!" && exit 1; fi
echo "LATEST_RELEASE_TAG=$release_tag" >> $GITHUB_ENV
- name: Upload release assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ env.LATEST_RELEASE_TAG }} ./dist/kubectl-node_ssm-${{ env.LATEST_RELEASE_TAG }}-*.tar.gz
gh release upload ${{ env.LATEST_RELEASE_TAG }} ./dist/kubectl-node_ssm-${{ env.LATEST_RELEASE_TAG }}-*.zip
gh release upload ${{ env.LATEST_RELEASE_TAG }} ./dist/kubectl-node_ssm-${{ env.LATEST_RELEASE_TAG }}-*.sha256
publish:
needs: release
name: bump krew-index version
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
name: Checkout repository
- uses: rajatjindal/[email protected]
name: Publish new version in krew-index