5
5
push :
6
6
branches :
7
7
- main
8
- # Release only if the 'version' field in Chart.yaml was updated
9
- paths :
10
- - helm-charts/**/Chart.yaml
11
8
12
9
jobs :
13
10
maybe_update :
@@ -18,37 +15,37 @@ jobs:
18
15
with :
19
16
fetch-depth : 0
20
17
21
- - name : Validate Chart.yaml Update
18
+ - name : Check if the release is needed
22
19
id : check_update_chart
23
20
run : |
24
- LATEST_VERSION=$(curl -s https://api .github.com/repos/signalfx/ splunk-otel-collector-chart/releases/latest | grep tag_name | cut -d - -f 4 | cut -d \" -f 1 )
25
- CURRENT_VERSION=$(cat helm-charts/splunk-otel-collector/Chart.yaml | grep -E "^version:" | cut -d " " -f 2 )
21
+ LATEST_VERSION=$(curl -s https://signalfx .github.io/ splunk-otel-collector-chart/index.yaml | yq e '.entries["splunk-otel-collector"][0].version' )
22
+ CURRENT_VERSION=$(yq e '.version' helm-charts/splunk-otel-collector/Chart.yaml)
26
23
if [ "$LATEST_VERSION" != "$CURRENT_VERSION" ]; then
27
24
echo "New release needed, creating..."
28
- echo "VALID_UPDATE =1" >> $GITHUB_OUTPUT
25
+ echo "NEED_RELEASE =1" >> $GITHUB_OUTPUT
29
26
else
30
27
echo "No new release needed"
31
- echo "VALID_UPDATE =0" >> $GITHUB_OUTPUT
28
+ echo "NEED_RELEASE =0" >> $GITHUB_OUTPUT
32
29
fi
33
30
exit 0
34
31
35
32
- name : Configure Git
36
33
run :
git config user.name "$GITHUB_ACTOR" && git config user.email "[email protected] "
37
- if : ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}
34
+ if : ${{ steps.check_update_chart.outputs.NEED_RELEASE == 1 }}
38
35
39
36
- name : Install Helm
40
37
uses : azure/setup-helm@v4
41
38
with :
42
39
version : v3.11.3
43
- if : ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}
40
+ if : ${{ steps.check_update_chart.outputs.NEED_RELEASE == 1 }}
44
41
45
42
- name : Set up chart dependencies
46
43
run : make render
47
- if : ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}
44
+ if : ${{ steps.check_update_chart.outputs.NEED_RELEASE == 1 }}
48
45
49
46
- name : Generate Release Notes
50
47
run : make chlog-release-notes OUTPUT=file
51
- if : ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}
48
+ if : ${{ steps.check_update_chart.outputs.NEED_RELEASE == 1 }}
52
49
53
50
- name : Run chart-releaser
54
51
57
54
config : .github/workflows/configs/cr.yaml
58
55
env :
59
56
CR_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
60
- if : ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}
57
+ if : ${{ steps.check_update_chart.outputs.NEED_RELEASE == 1 }}
0 commit comments