Skip to content

Commit 74d6c46

Browse files
committed
chore: add workflow to replace vcluster chart version
1 parent 47d57d3 commit 74d6c46

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: bump-vcluster
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
bump-vcluster-chart:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out repo
15+
uses: actions/checkout@v4
16+
17+
- name: Replace vcluster chart version
18+
env:
19+
VCLUSTER_RELEASE_VERSION: ${{ github.event.inputs.version }}
20+
run: |
21+
# Replace the old vcluster chart release with the new one in all relevant files
22+
sed -i "s/\${\(CHART_VERSION:=\)\([0-9]\+\.[0-9]\+\.[0-9]\+\)}/\${\1${VCLUSTER_RELEASE_VERSION#v}}/" README.md templates/cluster-template.yaml
23+
sed -i "s/\(CHART_VERSION=\)\([0-9]\+\.[0-9]\+\.[0-9]\+\)/\1${VCLUSTER_RELEASE_VERSION#v}/" README.md .github/workflows/e2e.yaml
24+
sed -i "s/\([ ]*Version: \"\)\([0-9]\+\.[0-9]\+\.[0-9]\+\)\"/\1${VCLUSTER_RELEASE_VERSION#v}\"/" test/controllerstest/controllers_suite_test.go
25+
26+
- name: Create pull request
27+
env:
28+
VCLUSTER_RELEASE_VERSION: ${{ github.event.inputs.version }}
29+
uses: peter-evans/create-pull-request@v7
30+
with:
31+
# TODO: Replace GITHUB_TOKEN with PAT with correct permissions
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
committer: Loft Bot <[email protected]>
34+
branch: bump-vcluster
35+
commit-message: "chore: bump vcluster chart to ${{ env.VCLUSTER_RELEASE_VERSION }}"
36+
title: "chore: bump vcluster chart to ${{ env.VCLUSTER_RELEASE_VERSION }}"
37+
body: Triggered by ${{ github.repository }}@${{ github.sha }}
38+
signoff: true
39+
delete-branch: true
40+

0 commit comments

Comments
 (0)