-
Notifications
You must be signed in to change notification settings - Fork 14
59 lines (55 loc) · 1.6 KB
/
Copy pathrelease.yml
File metadata and controls
59 lines (55 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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 }}
- 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 --clean
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"