Skip to content
name: Update Helm Charts on New Release
on:
release:
types: [published, released]
workflow_dispatch:
inputs:
version:
description: 'release version'
required: true
env:
NEW_APP_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}
jobs:
update-helm-charts:
runs-on: ubuntu-latest
steps:
- name: Checkout Helm Charts Repository
uses: actions/checkout@v3
with:
repository: 'risingwavelabs/helm-charts'
token: ${{ secrets.PR_TOKEN }}
path: 'helm-charts'
- name: Run CMD
run: |
cd helm-charts
make sync-crds
- name: Update values.yaml
run: |
sed -i "s/^ tag:.*/ tag: \"${{ env.NEW_APP_VERSION }}\"/" helm-charts/charts/risingwave-operator/values.yaml
- name: Update Chart.yaml
run: |
cd helm-charts/charts/risingwave-operator
CURRENT_VERSION=$(grep 'version:' Chart.yaml | awk '{print $2}' | head -n 1)
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. -v OFS='.' '{$NF++; print}')
sed -i "/type: application/,/version:/!b; /version:/s/version: .*/version: $NEW_VERSION/" Chart.yaml
sed -i "s/^appVersion: .*/appVersion: \"${{ env.NEW_APP_VERSION }}\"/" Chart.yaml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PR_TOKEN }}
commit-message: 'chore: release risingwave-operator ${{ env.NEW_APP_VERSION }}'
title: 'chore: release risingwave-operator ${{ env.NEW_APP_VERSION }}'
body: 'This is an automated pull request to update helm-chart by risingwave-operator new release'
branch: 'auto-update-${{ env.NEW_APP_VERSION }}'
path: 'helm-charts'
reviewers: arkbriar
delete-branch: true
signoff: true