-
Notifications
You must be signed in to change notification settings - Fork 19
54 lines (47 loc) · 1.86 KB
/
auto_update_helm_by_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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