77concurrency : release-${{ github.event.release.tag_name }}
88
99env :
10+ HELM_VERSION : v3.11.3
1011 REGCTL_VERSION : v0.4.8
1112 REGISTRY : ghcr.io
1213 CHART_DIRECTORY : chart
@@ -16,6 +17,21 @@ defaults:
1617 shell : bash
1718
1819jobs :
20+ publish-go-module :
21+ name : Publish go module
22+ runs-on : ubuntu-24.04
23+
24+ steps :
25+ - name : Trigger registration on sum.golang.org
26+ run : |
27+ repository=${{ github.repository }}
28+ tag=${{ github.event.release.tag_name }}
29+ curl -sSf \
30+ --max-time 30 \
31+ --retry 5 \
32+ --retry-max-time 300 \
33+ https://sum.golang.org/lookup/github.com/${repository,,}@${tag}
34+
1935 validate :
2036 name : Run validations
2137 runs-on : ubuntu-24.04
@@ -138,3 +154,36 @@ jobs:
138154 repository=$REGISTRY/${{ github.repository }}/crds
139155 tar cvz * | regctl artifact put -m application/gzip ${repository,,}:${{ github.event.release.tag_name }}
140156
157+ publish-chart :
158+ name : Publish chart to github packages
159+ runs-on : ubuntu-24.04
160+ needs : validate
161+ permissions :
162+ contents : read
163+ packages : write
164+
165+ steps :
166+ - name : Checkout repository
167+ uses : actions/checkout@v4
168+
169+ - uses : azure/setup-helm@v4
170+ with :
171+ version : ${{ env.HELM_VERSION }}
172+
173+ - name : Create package
174+ run : |
175+ chart_version=$(yq .version $CHART_DIRECTORY/Chart.yaml)
176+ helm package --version $chart_version $CHART_DIRECTORY
177+
178+ - name : Login to the OCI registry
179+ run : |
180+ helm --registry-config $RUNNER_TEMP/helm-config.json registry login $REGISTRY -u ${{ github.actor }} --password-stdin <<< ${{ github.token }}
181+
182+ - name : Upload package
183+ run : |
184+ chart_name=$(yq .name $CHART_DIRECTORY/Chart.yaml)
185+ chart_version=$(yq .version $CHART_DIRECTORY/Chart.yaml)
186+ file=$chart_name-$chart_version.tgz
187+ repository=$REGISTRY/${{ github.repository }}/charts
188+ helm --registry-config $RUNNER_TEMP/helm-config.json push $file oci://${repository,,}
189+
0 commit comments