-
Notifications
You must be signed in to change notification settings - Fork 182
61 lines (53 loc) · 1.8 KB
/
release.yaml
File metadata and controls
61 lines (53 loc) · 1.8 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
name: Release Charts
on:
push:
branches:
- main
jobs:
release:
permissions:
contents: write # for pushing to gh-pages (HTTPS Helm repository)
packages: write # for pushing to GHCR (OCI Helm repository)
id-token: write # for signing with keyless cosign
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Cosign
uses: sigstore/cosign-installer@v4.1.1
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Add Helm repositories
run: |
helm repo add dandydev https://dandydeveloper.github.io/charts
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.7.0
with:
charts_dir: helm
skip_existing: true
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_GENERATE_RELEASE_NOTES: true
# See https://github.com/helm/chart-releaser/issues/183
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Charts to GHCR and Sign
run: |
shopt -s nullglob
for pkg in .cr-release-packages/*; do
if [ -z "${pkg:-}" ]; then
break
fi
chart_name=$(echo "${pkg##*/}" | sed 's/-[0-9].*$//')
repo="ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"
helm push "${pkg}" "oci://${repo}" |& grep Digest: | awk '{print $NF}' > digest.txt
cosign sign --yes "${repo}/${chart_name}@$(cat digest.txt)"
done