Update from https://github.com/otwld/velero-ui/commit/d689d7b9a2114fd… #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Charts | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- "charts/**" | |
permissions: | |
contents: read | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Set up Helm | |
uses: azure/setup-helm@v4 | |
- name: Add chart dependencies | |
run: | | |
find . -name "Chart.yaml" -print0 | while IFS= read -r -d '' chart; do | |
if grep -q "dependencies:" "$chart"; then | |
dependencies=$(yq e '.dependencies[] | .repository + " " + .name' "$chart") | |
while read -r repo name; do | |
if ! helm repo list | grep -q "$repo"; then | |
helm repo add "$name" "$repo" | |
fi | |
done <<< "$dependencies" | |
chart_dir=$(dirname "$chart") | |
(cd "$chart_dir" && helm dependency build) | |
fi | |
done | |
- name: Build chart dependencies | |
run: | | |
for dir in charts/*/ | |
do | |
(cd ${dir}; helm dependency build) | |
done | |
- name: Run chart-releaser | |
uses: helm/[email protected] | |
env: | |
CR_SKIP_EXISTING: true | |
CR_GENERATE_RELEASE_NOTES: true | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
CR_RELEASE_NAME_TEMPLATE: "{{ .Name }}-{{ .Version }}" |