Skip to content

Commit 717f1a3

Browse files
committed
add helm ci
1 parent 0f168af commit 717f1a3

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/release.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212
env:
1313
REGISTRY: ghcr.io
1414
IMAGE_NAME: ${{ github.repository }}
15+
RELEASE_VERSION: ${{ github.ref_name }}
1516

1617
jobs:
1718
goreleaser:
@@ -31,6 +32,7 @@ jobs:
3132
args: release --clean
3233
env:
3334
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
3436
packagerelease:
3537
runs-on: ubuntu-latest
3638
permissions:
@@ -66,11 +68,26 @@ jobs:
6668
tags: ${{ steps.meta.outputs.tags }}
6769
labels: ${{ steps.meta.outputs.labels }}
6870
build-args: |
69-
VERSION=${{ github.ref_name }}
70-
71+
VERSION=${RELEASE_VERSION}
7172
- name: Generate artifact attestation
7273
uses: actions/attest-build-provenance@v3
7374
with:
7475
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
7576
subject-digest: ${{ steps.push.outputs.digest }}
7677
push-to-registry: true
78+
79+
- name: Set up Helm
80+
uses: azure/setup-helm@v4
81+
- name: Log in to GitHub Container Registry
82+
run: |
83+
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
84+
- name: Prepare and package Helm chart
85+
run: |
86+
CLEAN_VERSION=$(echo "$RELEASE_VERSION" | sed 's/^v//')
87+
echo "Using chart version and appVersion: $CLEAN_VERSION"
88+
sed -i "s/^version: .*/version: ${CLEAN_VERSION}/" ./helm/Chart.yaml
89+
sed -i "s/^appVersion: .*/appVersion: ${CLEAN_VERSION}/" ./helm/Chart.yaml
90+
helm package ./helm -d .
91+
- name: Push Helm chart to GHCR
92+
run: |
93+
helm push "./netassert-${CLEAN_VERSION}.tgz" oci://ghcr.io/${{ github.repository_owner }}/charts

0 commit comments

Comments
 (0)