build: Preparing release v0.8.3 #19
Workflow file for this run
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: 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: 1.21.1 | |
- 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@v2 | |
with: | |
registry: ghcr.io | |
username: kluctlbot | |
password: ${{ secrets.GHCR_TOKEN }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
key: ${{ runner.os }}-goreleaser-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-goreleaser- | |
- name: Generate release artifacts | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
mkdir -p config/release | |
kustomize build ./config/crd > ./config/release/${{ env.CONTROLLER }}.crds.yaml | |
kustomize build ./config/manager > ./config/release/${{ env.CONTROLLER }}.deployment.yaml | |
echo '[CHANGELOG](https://github.com/kluctl/${{ env.CONTROLLER }}/blob/main/CHANGELOG.md)' > ./config/release/notes.md | |
- name: Run GoReleaser | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --release-notes=config/release/notes.md --rm-dist --skip-validate | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |