chore: add chart release workflow

This commit is contained in:
Josh Sizer
2024-03-24 17:25:08 -04:00
parent 1d81ad83c5
commit 8694346264
2 changed files with 38 additions and 0 deletions

37
.github/workflows/helm_release.yaml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: Release Charts
on:
push:
branches:
- main
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install chart-releaser
uses: helm/chart-releaser-action@v1.6.0
with:
install_only: true
- name: Run chart-releaser
env:
CR_TOKEN: "${{ secrets.CR_TOKEN }}"
run: |
owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY")
cr package
cr upload --owner="$owner" --git-repo "$repo" --token="$CR_TOKEN" --release-name-template="v{{ .Version }}" --packages-with-index --push --skip-existing --generate-release-notes --commit main
cr index --owner="$owner" --git-repo "$repo" --token="$CR_TOKEN" --release-name-template="v{{ .Version }}" --packages-with-index --push --index-path="."

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.cr-release-packages