Merge pull request #10 from mayur-tolexo/feat/opencost-pricing #1
Workflow file for this run
This file contains hidden or 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: 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 |