Skip to content

build: Preparing release v0.9.0 #20

build: Preparing release v0.9.0

build: Preparing release v0.9.0 #20

Workflow file for this run

name: goreleaser
on:
push:
# run only against tags
tags:
- 'v*'
permissions:
contents: write # needed to write releases
id-token: write # needed for keyless signing
packages: write # needed for ghcr access
env:
CONTROLLER: ${{ github.event.repository.name }}
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Setup Syft
uses: anchore/sbom-action/download-syft@v0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: kluctlbot
password: ${{ secrets.GHCR_TOKEN }}
- uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-goreleaser-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-goreleaser-
- name: Generate helm package
run: |
make helm-package
- name: Run GoReleaser
if: startsWith(github.ref, 'refs/tags/v')
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --release-notes=config/release/notes.md --rm-dist --skip-validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push chart to GHCR
if: startsWith(github.ref, 'refs/tags/v')
run: |
helm push ./bin/chart/template-controller-*.tgz "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"