-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (57 loc) · 1.99 KB
/
Copy pathrelease.yaml
File metadata and controls
69 lines (57 loc) · 1.99 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
60
61
62
63
64
65
66
67
68
69
name: Release
on:
push:
tags: ["v*"]
permissions:
contents: read
packages: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v6
id: meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- uses: docker/build-push-action@v7
id: build
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
provenance: mode=max
sbom: true
cache-from: type=gha
cache-to: type=gha,mode=max
- uses: sigstore/cosign-installer@v3
- name: Sign image (keyless cosign)
run: |
cosign sign --yes "ghcr.io/${{ github.repository }}@${{ steps.build.outputs.digest }}"
- uses: anchore/sbom-action@v0
with:
image: "ghcr.io/${{ github.repository }}@${{ steps.build.outputs.digest }}"
artifact-name: sbom-${{ github.ref_name }}.spdx.json
output-file: sbom-${{ github.ref_name }}.spdx.json
- name: Publish Helm chart (OCI)
run: |
set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u "${{ github.actor }}" --password-stdin
helm package charts/karpenter-provider-hetzner --version "$VERSION" --app-version "$VERSION"
helm push "karpenter-provider-hetzner-${VERSION}.tgz" oci://ghcr.io/${{ github.repository_owner }}/charts