1- name : Publish Helm charts to OCI Registry
2-
3- on :
4- push :
5- branches :
6- - main
7- # Publish when a new tag is pushed
8- tags :
9- - ' v*'
10- # Allow manual trigger
11- workflow_dispatch :
12-
13- jobs :
14- publish :
15- runs-on : ubuntu-latest
16- permissions :
17- contents : read
18- packages : write
19- steps :
20- - name : Checkout
21- uses : actions/checkout@v4
22- with :
23- fetch-depth : 0
24-
25- - name : Set up Helm
26- uses : azure/setup-helm@v3
27- with :
28- version : ' latest'
29-
30- - name : Login to GitHub Container Registry
31- uses : docker/login-action@v3
32- with :
33- registry : ghcr.io
34- username : ${{ github.actor }}
35- password : ${{ secrets.GITHUB_TOKEN }}
36-
37- - name : Set up chart-releaser
38- 39- with :
40- install_only : true
41-
42- - name : Set up tags
43- run : |
44- echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
45- echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
46- # Default version for non-tag builds
47- if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
48- echo "CHARTS_VERSION=0.0.0-${GITHUB_SHA::8}" >> $GITHUB_ENV
49- elif [[ "${{ github.ref }}" == refs/tags/v* ]]; then
50- echo "CHARTS_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
51- else
52- echo "CHARTS_VERSION=0.0.0-dev" >> $GITHUB_ENV
53- fi
54-
55- - name : Package and push OpenCloud chart
56- run : |
57- # Update Chart.yaml version if we have a tag
58- if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
59- echo "Updating chart version to ${{ env.CHARTS_VERSION }}"
60- sed -i "s/^version:.*/version: ${{ env.CHARTS_VERSION }}/" charts/opencloud/Chart.yaml
61- fi
62-
63- # Package Helm chart
64- helm package charts/opencloud
65-
66- # Push to GHCR
67- helm push opencloud-*.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts/
68-
69- # Verify the pushed chart
70- echo "Verifying the pushed chart..."
71- helm pull oci://ghcr.io/${{ github.repository_owner }}/helm-charts/opencloud --version $(helm show chart charts/opencloud | grep version | awk '{print $2}')
72-
73- - name : Package and push OpenCloud Dev chart
74- run : |
75- # Update Chart.yaml version if we have a tag
76- if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
77- echo "Updating chart version to ${{ env.CHARTS_VERSION }}"
78- sed -i "s/^version:.*/version: ${{ env.CHARTS_VERSION }}/" charts/opencloud-dev/Chart.yaml
79- fi
80-
81- # Package Helm chart
82- helm package charts/opencloud-dev
83-
84- # Push to GHCR
85- helm push opencloud-dev-*.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts/
86-
87- # Verify the pushed chart
88- echo "Verifying the pushed chart..."
89- helm pull oci://ghcr.io/${{ github.repository_owner }}/helm-charts/opencloud-dev --version $(helm show chart charts/opencloud-dev | grep version | awk '{print $2}')
90-
91- - name : Package and push OpenCloud Full chart
92- run : |
93- # Update Chart.yaml version if we have a tag
94- if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
95- echo "Updating chart version to ${{ env.CHARTS_VERSION }}"
96- sed -i "s/^version:.*/version: ${{ env.CHARTS_VERSION }}/" charts/opencloud-full/Chart.yaml
97- fi
98-
99- # Package Helm chart
100- helm package charts/opencloud-full
101-
102- # Push to GHCR
103- helm push opencloud-full-*.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts/
104-
105- # Verify the pushed chart
106- echo "Verifying the pushed chart..."
1+ name : Publish Helm charts to OCI Registry
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ # Publish when a new tag is pushed
8+ tags :
9+ - ' v*'
10+ # Allow manual trigger
11+ workflow_dispatch :
12+
13+ jobs :
14+ publish :
15+ runs-on : ubuntu-latest
16+ permissions :
17+ contents : read
18+ packages : write
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v4
22+ with :
23+ fetch-depth : 0
24+
25+ - name : Set up Helm
26+ uses : azure/setup-helm@v3
27+ with :
28+ version : ' latest'
29+
30+ - name : Login to GitHub Container Registry
31+ uses : docker/login-action@v3
32+ with :
33+ registry : ghcr.io
34+ username : ${{ github.actor }}
35+ password : ${{ secrets.GITHUB_TOKEN }}
36+
37+ - name : Set up chart-releaser
38+ 39+ with :
40+ install_only : true
41+
42+ - name : Set up tags
43+ run : |
44+ echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
45+ echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
46+ # Default version for non-tag builds
47+ if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
48+ echo "CHARTS_VERSION=0.0.0-${GITHUB_SHA::8}" >> $GITHUB_ENV
49+ elif [[ "${{ github.ref }}" == refs/tags/v* ]]; then
50+ echo "CHARTS_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
51+ else
52+ echo "CHARTS_VERSION=0.0.0-dev" >> $GITHUB_ENV
53+ fi
54+
55+ - name : Package and push OpenCloud chart
56+ run : |
57+ # Update Chart.yaml version if we have a tag
58+ if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
59+ echo "Updating chart version to ${{ env.CHARTS_VERSION }}"
60+ sed -i "s/^version:.*/version: ${{ env.CHARTS_VERSION }}/" charts/opencloud/Chart.yaml
61+ fi
62+
63+ # Package Helm chart
64+ helm package charts/opencloud
65+
66+ # Push to GHCR
67+ helm push opencloud-*.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts/
68+
69+ # Verify the pushed chart
70+ echo "Verifying the pushed chart..."
71+ helm pull oci://ghcr.io/${{ github.repository_owner }}/helm-charts/opencloud --version $(helm show chart charts/opencloud | grep version | awk '{print $2}')
72+
73+ - name : Package and push OpenCloud Dev chart
74+ run : |
75+ # Update Chart.yaml version if we have a tag
76+ if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
77+ echo "Updating chart version to ${{ env.CHARTS_VERSION }}"
78+ sed -i "s/^version:.*/version: ${{ env.CHARTS_VERSION }}/" charts/opencloud-dev/Chart.yaml
79+ fi
80+
81+ # Package Helm chart
82+ helm package charts/opencloud-dev
83+
84+ # Push to GHCR
85+ helm push opencloud-dev-*.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts/
86+
87+ # Verify the pushed chart
88+ echo "Verifying the pushed chart..."
89+ helm pull oci://ghcr.io/${{ github.repository_owner }}/helm-charts/opencloud-dev --version $(helm show chart charts/opencloud-dev | grep version | awk '{print $2}')
90+
91+ - name : Package and push OpenCloud Full chart
92+ run : |
93+ # Update Chart.yaml version if we have a tag
94+ if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
95+ echo "Updating chart version to ${{ env.CHARTS_VERSION }}"
96+ sed -i "s/^version:.*/version: ${{ env.CHARTS_VERSION }}/" charts/opencloud-full/Chart.yaml
97+ fi
98+
99+ # Package Helm chart
100+ helm package charts/opencloud-full
101+
102+ # Push to GHCR
103+ helm push opencloud-full-*.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts/
104+
105+ # Verify the pushed chart
106+ echo "Verifying the pushed chart..."
107107 helm pull oci://ghcr.io/${{ github.repository_owner }}/helm-charts/opencloud-full --version $(helm show chart charts/opencloud-full | grep version | awk '{print $2}')
0 commit comments