Skip to content

Merge pull request #14 from mayur-tolexo/docs/release-v0.1.1-prep #2

Merge pull request #14 from mayur-tolexo/docs/release-v0.1.1-prep

Merge pull request #14 from mayur-tolexo/docs/release-v0.1.1-prep #2

Workflow file for this run

name: Release
# Cut a release by pushing a semver tag:
# git tag v0.1.0 && git push origin v0.1.0
# GoReleaser builds cross-platform binaries + archives + checksums and creates a DRAFT GitHub
# release; this workflow then renders the krew plugin manifest from the checksums and attaches
# it. Review the draft and publish it from the GitHub UI.
on:
push:
tags:
- "v*"
permissions:
contents: write # create the release and upload assets
jobs:
goreleaser:
runs-on: ubuntu-latest
env:
GOFLAGS: -mod=mod
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history + tags for the changelog
- uses: actions/setup-go@v5
with:
go-version: "1.26"
cache: true
- name: Validate GoReleaser config
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: check
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Render krew plugin manifest
run: scripts/gen-krew-manifest.sh "${GITHUB_REF_NAME}" dist/checksums.txt .krew.yaml.tmpl dist/kubetidy.yaml
- name: Attach krew manifest to the release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${GITHUB_REF_NAME}" dist/kubetidy.yaml --clobber