Skip to content

Commit 696ec3b

Browse files
authored
Set chart version from the git tag (#13)
1 parent 91951b2 commit 696ec3b

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

.github/workflows/push-chart.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,21 @@ jobs:
2929
username: ${{ github.actor }}
3030
password: ${{ secrets.GITHUB_TOKEN }}
3131

32+
- name: Extract version from tag
33+
id: get_version
34+
run: |
35+
VERSION=${GITHUB_REF#refs/tags/v}
36+
echo "version=$VERSION" >> $GITHUB_OUTPUT
37+
echo "Chart version: $VERSION"
38+
39+
- name: Update Chart.yaml with version
40+
run: |
41+
sed -i "s/^version:.*/version: ${{ steps.get_version.outputs.version }}/" ./chart/Chart.yaml
42+
sed -i "s/^appVersion:.*/appVersion: \"${{ steps.get_version.outputs.version }}\"/" ./chart/Chart.yaml
43+
cat ./chart/Chart.yaml
44+
3245
- name: Publish Helm chart to GHCR
3346
run: |
3447
helm package chart
35-
export CHART_VERSION=$(grep 'version:' ./chart/Chart.yaml | tail -n1 | awk '{ print $2 }')
36-
helm push domaineer-$CHART_VERSION.tgz oci://${{ env.REGISTRY }}/gldraphael/charts
37-
rm domaineer-$CHART_VERSION.tgz
48+
helm push domaineer-${{ steps.get_version.outputs.version }}.tgz oci://${{ env.REGISTRY }}/gldraphael/charts
49+
rm domaineer-${{ steps.get_version.outputs.version }}.tgz

chart/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: domaineer
3-
description: domaineer.xyz
3+
description: Helm chart for domaineer.
44
type: application
55

6-
version: 0.1.0
7-
appVersion: "1.16.0"
6+
version: 0.0.0
7+
appVersion: "0.0.0"

chart/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
domaineer.xyz installed!
1+
domaineer installed!

chart/values.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# Default values for chart.
2-
# This is a YAML-formatted file.
3-
# Declare variables to be passed into your templates.
4-
51
replicaCount: 1
62

73
image:
@@ -44,10 +40,6 @@ service:
4440
port: 80
4541

4642
resources: {}
47-
# We usually recommend not to specify default resources and to leave this as a conscious
48-
# choice for the user. This also increases chances charts run on environments with little
49-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
50-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
5143
# limits:
5244
# cpu: 100m
5345
# memory: 128Mi

0 commit comments

Comments
 (0)