Skip to content

chore: release v0.0.3 (#144) #25

chore: release v0.0.3 (#144)

chore: release v0.0.3 (#144) #25

name: Release Helm Charts
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "helm/**"
- ".github/workflows/helm-chart-release.yml"
permissions: read-all
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # chart-releaser pushes the gh-pages index and creates releases
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
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 Helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5
with:
version: v3.20.2
# chart-releaser expects its pages branch to exist. Bootstrap an empty
# branch on the first release without modifying the checked-out tree.
- name: Ensure chart repository branch exists
env:
CR_PAGES_BRANCH: helm-chart-release
run: |
if ! git ls-remote --exit-code --heads origin "${CR_PAGES_BRANCH}" >/dev/null; then
empty_tree="$(git hash-object -t tree /dev/null)"
initial_commit="$(printf 'Initialize Helm chart repository\n' | git commit-tree "${empty_tree}")"
git push origin "${initial_commit}:refs/heads/${CR_PAGES_BRANCH}"
fi
- name: Run chart-releaser
uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0
with:
# The charts directory
charts_dir: helm
# Chart changes without a version bump must not fail on the existing release.
skip_existing: true
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NAME_TEMPLATE: "{{ .Name }}-helm-{{ .Version }}"
CR_PAGES_BRANCH: "helm-chart-release"