forked from qirelo/helm-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (52 loc) · 1.58 KB
/
Copy pathrelease-chart.yaml
File metadata and controls
65 lines (52 loc) · 1.58 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
name: Release Helm chart
on:
push:
tags:
- "*-v*"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v3.14.0
- name: Parse tag
id: parse
run: |
TAG=${GITHUB_REF#refs/tags/}
CHART_NAME=${TAG%%-v*}
CHART_VERSION=${TAG##*-v}
echo "chart=$CHART_NAME" >> $GITHUB_OUTPUT
echo "version=$CHART_VERSION" >> $GITHUB_OUTPUT
- name: Validate chart directory
run: |
if [ ! -d "${{ steps.parse.outputs.chart }}" ]; then
echo "Chart directory not found"
exit 1
fi
- name: Helm lint
run: |
helm lint ${{ steps.parse.outputs.chart }}
- name: Update chart version
run: |
sed -i "s/^version:.*/version: ${{ steps.parse.outputs.version }}/" \
${{ steps.parse.outputs.chart }}/Chart.yaml
- name: Helm login to GHCR
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io \
--username ${{ github.actor }} \
--password-stdin
- name: Package chart
run: |
helm package ${{ steps.parse.outputs.chart }}
- name: Push chart to OCI
run: |
helm push \
${{ steps.parse.outputs.chart }}-${{ steps.parse.outputs.version }}.tgz \
oci://ghcr.io/${{ github.repository_owner }}