-
Notifications
You must be signed in to change notification settings - Fork 0
203 lines (176 loc) · 6.01 KB
/
helm.yaml
File metadata and controls
203 lines (176 loc) · 6.01 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: Helm Chart
on:
push:
branches:
- main
paths:
- 'helm/**'
- '.github/workflows/helm.yaml'
pull_request:
paths:
- 'helm/**'
- '.github/workflows/helm.yaml'
release:
types: [published]
env:
CHART_DIR: helm
CHART_NAME: tempo-monitor
OCI_REGISTRY: ghcr.io
jobs:
# Lint
lint:
name: Lint Helm chart
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.17.0
- name: Add Bitnami repo
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami --force-update
helm repo update
- name: Helm lint
run: |
helm lint --strict --set profile=full --set tempo.image=ghcr.io/tempoxyz/tempo:1.4.1 ./helm
# Validate (dry-run install)
validate:
name: Validate Kubernetes install (dry-run)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.17.0
- name: Create genesis placeholder
run: |
mkdir -p consensus
echo '{"config":{},"genesis_time":"","nonce":"0x0000000000000000","extradata":"","alloc":{},"number":"0","gas_limit":"0","difficulty":"0"}' \
> consensus/genesis.json
- name: Helm dry-run (consensus profile)
run: |
helm template release-test ./helm \
--namespace tempo-test \
--create-namespace \
--set profile=consensus \
--set tempo.image=ghcr.io/tempoxyz/tempo:1.4.1 \
--set validators.count=2 \
--set rpc.count=1 \
--set faucet.enabled=true \
--set monitoring.enabled=false \
--debug --dry-run=server 2>&1 | head -200
- name: Helm dry-run (full profile)
run: |
helm template release-test ./helm \
--namespace tempo-test \
--create-namespace \
--set profile=full \
--set tempo.image=ghcr.io/tempoxyz/tempo:1.4.1 \
--set validators.count=4 \
--set rpc.count=2 \
--set monitoring.enabled=true \
--debug --dry-run=server 2>&1 | head -200
# Package
package:
name: Package Helm chart
runs-on: ubuntu-latest
needs: [lint, validate]
outputs:
chart_version: ${{ steps.meta.outputs.version }}
chart_basename: ${{ steps.meta.outputs.basename }}
steps:
- uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.17.0
- name: Copy genesis placeholder into chart
run: |
mkdir -p consensus
echo '{"config":{},"genesis_time":"","nonce":"0x0000000000000000","extradata":"","alloc":{},"number":"0","gas_limit":"0","difficulty":"0"}' \
> consensus/genesis.json
- id: meta
run: |
VERSION=$(helm show chart ./helm/ | grep '^version:' | awk '{print $2}' | xargs)
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "basename=tempo-monitor-${VERSION}.tgz" >> $GITHUB_OUTPUT
- name: Helm package
run: |
helm package ./helm/ --destination /tmp/helm-charts/
ls -la /tmp/helm-charts/
- name: Upload chart artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.meta.outputs.chart_basename }}
path: /tmp/helm-charts/${{ steps.meta.outputs.chart_basename }}
retention-days: 5
# Publish to GHCR (on main / release only)
publish:
name: Publish Helm chart to GHCR
runs-on: ubuntu-latest
needs: [package]
permissions:
contents: read
packages: write
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
HELM_EXPERIMENTAL_OCI: 1
steps:
- uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.17.0
key: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.OCI_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download chart artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.package.outputs.chart_basename }}
path: /tmp/helm-charts/
- name: Push chart to GHCR
env:
HELM_EXPERIMENTAL_OCI: 1
run: |
CHART_REF="${{ env.OCI_REGISTRY }}/${{ github.repository_owner }}/${{ env.CHART_NAME }}"
VERSION="${{ needs.package.outputs.chart_version }}"
FILE="${{ needs.package.outputs.chart_basename }}"
helm chart save /tmp/helm-charts/${FILE} ${CHART_REF}:${VERSION}
helm chart push ${CHART_REF}:${VERSION}
helm chart save /tmp/helm-charts/${FILE} ${CHART_REF}:latest
helm chart push ${CHART_REF}:latest
- name: Show published tags
run: |
CHART_REF="${{ env.OCI_REGISTRY }}/${{ github.repository_owner }}/${{ env.CHART_NAME }}"
VERSION="${{ needs.package.outputs.chart_version }}"
echo "Published: ${CHART_REF}:${VERSION}"
echo "Published: ${CHART_REF}:latest"
# SLSA provenance
provenance:
name: Generate SLSA provenance
runs-on: ubuntu-latest
needs: [publish]
permissions:
actions: read
id-token: write
contents: write
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Download chart artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.package.outputs.chart_basename }}
path: /tmp/
- name: Generate SLSA provenance
uses: actions/attest-build-provenance@v2
with:
subject-name: "${{ env.OCI_REGISTRY }}/${{ github.repository_owner }}/${{ env.CHART_NAME }}"
sha512: ${{ hashFiles('/tmp/*.tgz') }}