-
Notifications
You must be signed in to change notification settings - Fork 151
59 lines (51 loc) · 1.83 KB
/
release.yaml
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
55
56
57
58
59
name: Release Charts
on:
push:
branches:
- main
# Release only if the 'version' field in Chart.yaml was updated
paths:
- helm-charts/**/Chart.yaml
jobs:
maybe_update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate Chart.yaml Update
id: check_update_chart
run: |
VERSION_DIFF=$(git diff HEAD^ -- "*Chart.yaml" | grep -E "^\+version:" || echo "")
echo "VERSION_DIFF=$VERSION_DIFF" # example value: +version: 0.80.1
if [[ ! -z "$VERSION_DIFF" ]]; then
echo "New release needed, creating..."
echo "VALID_UPDATE=1" >> $GITHUB_OUTPUT
else
echo "No new release needed"
echo "VALID_UPDATE=0" >> $GITHUB_OUTPUT
fi
exit 0
- name: Configure Git
run: git config user.name "$GITHUB_ACTOR" && git config user.email "[email protected]"
if: ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v3.11.3
if: ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}
- name: Set up chart dependencies
run: make render
if: ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}
- name: Generate Release Notes
run: make chlog-release-notes OUTPUT=file
if: ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: helm-charts
config: .github/workflows/configs/cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}