1
+ ---
2
+ name : Release with GGScout Version
3
+
4
+ on :
5
+ workflow_dispatch :
6
+ inputs :
7
+ ggscout_version :
8
+ description : ' GGScout version to use for schemas (e.g., v0.17.5, latest)'
9
+ required : true
10
+ default : ' latest'
11
+ type : string
12
+ chart_increment :
13
+ description : ' Chart version increment type'
14
+ required : true
15
+ default : ' patch'
16
+ type : choice
17
+ options :
18
+ - patch
19
+ - minor
20
+ - major
21
+ update_app_version :
22
+ description : ' Update Chart.yaml appVersion to match GGScout version'
23
+ required : false
24
+ default : true
25
+ type : boolean
26
+
27
+ concurrency :
28
+ group : release-${{ github.ref }}
29
+ cancel-in-progress : false
30
+
31
+ jobs :
32
+ release :
33
+ runs-on : ubuntu-latest
34
+ permissions :
35
+ contents : write
36
+ pull-requests : write
37
+
38
+ steps :
39
+ - name : Checkout repository
40
+ uses : actions/checkout@v4
41
+ with :
42
+ fetch-depth : 0
43
+ token : ${{ secrets.GITHUB_TOKEN }}
44
+
45
+ - name : Configure Git
46
+ run : |
47
+ git config user.name "github-actions[bot]"
48
+ git config user.email "github-actions[bot]@users.noreply.github.com"
49
+
50
+ - name : Setup mise
51
+ uses : jdx/mise-action@v2
52
+
53
+ - name : Display release information
54
+ run : |
55
+ echo "🚀 Starting GGScout Helm Chart Release"
56
+ echo "======================================"
57
+ echo "GGScout Version: ${{ github.event.inputs.ggscout_version }}"
58
+ echo "Chart Increment: ${{ github.event.inputs.chart_increment }}"
59
+ echo "Update App Version: ${{ github.event.inputs.update_app_version }}"
60
+ echo "======================================"
61
+
62
+ - name : Install required tools
63
+ run : |
64
+ echo "Installing Helm plugins..."
65
+ mise run install-helm-plugins
66
+
67
+ - name : Fetch and bundle schemas
68
+ run : |
69
+ echo "Fetching schemas for GGScout version: ${{ github.event.inputs.ggscout_version }}"
70
+ mise run bundle-schemas "${{ github.event.inputs.ggscout_version }}"
71
+
72
+ - name : Update Chart.yaml appVersion
73
+ if : github.event.inputs.update_app_version == 'true'
74
+ run : |
75
+ GGSCOUT_VERSION="${{ github.event.inputs.ggscout_version }}"
76
+ CHART_FILE="charts/ggscout/Chart.yaml"
77
+
78
+ echo "Updating Chart.yaml appVersion to: ${GGSCOUT_VERSION}"
79
+
80
+ # Remove 'v' prefix if present for appVersion
81
+ APP_VERSION="${GGSCOUT_VERSION#v}"
82
+
83
+ # Update appVersion in Chart.yaml
84
+ if command -v yq >/dev/null 2>&1; then
85
+ yq eval ".appVersion = \"${APP_VERSION}\"" -i "${CHART_FILE}"
86
+ else
87
+ # Fallback to sed if yq is not available
88
+ sed -i "s/^appVersion:.*/appVersion: \"${APP_VERSION}\"/" "${CHART_FILE}"
89
+ fi
90
+
91
+ echo "Updated appVersion in ${CHART_FILE}:"
92
+ grep "appVersion:" "${CHART_FILE}"
93
+
94
+ - name : Run tests
95
+ run : |
96
+ echo "Running Helm chart tests..."
97
+ mise run test
98
+
99
+ - name : Run linting
100
+ run : |
101
+ echo "Running Helm chart linting..."
102
+ mise run lint
103
+
104
+ - name : Check for changes
105
+ id : check_changes
106
+ run : |
107
+ if git diff --quiet; then
108
+ echo "No changes detected"
109
+ echo "has_changes=false" >> $GITHUB_OUTPUT
110
+ else
111
+ echo "Changes detected:"
112
+ git diff --name-only
113
+ echo "has_changes=true" >> $GITHUB_OUTPUT
114
+ fi
115
+
116
+ - name : Commit schema and Chart.yaml updates
117
+ if : steps.check_changes.outputs.has_changes == 'true'
118
+ run : |
119
+ echo "Committing updates..."
120
+ git add .
121
+ git commit -m "feat: update schemas and appVersion for GGScout ${{ github.event.inputs.ggscout_version }}
122
+
123
+ - Fetch schemas from GGScout version ${{ github.event.inputs.ggscout_version }}
124
+ - Update bundled values.schema.json
125
+ $(if [ '${{ github.event.inputs.update_app_version }}' = 'true' ]; then echo '- Update Chart.yaml appVersion'; fi)
126
+
127
+ 🤖 Generated with [Claude Code](https://claude.ai/code)
128
+
129
+ Co-Authored-By: Claude <[email protected] >"
130
+
131
+ - name : Create release
132
+ run : |
133
+ echo "Creating Helm chart release..."
134
+ cz bump --increment "${{ github.event.inputs.chart_increment }}"
135
+
136
+ - name : Push changes and tags
137
+ run : |
138
+ echo "Pushing changes and tags to repository..."
139
+ git push origin main --follow-tags
140
+
141
+ - name : Generate release summary
142
+ run : |
143
+ echo "## 🎉 Release Summary" >> $GITHUB_STEP_SUMMARY
144
+ echo "" >> $GITHUB_STEP_SUMMARY
145
+ echo "| Parameter | Value |" >> $GITHUB_STEP_SUMMARY
146
+ echo "|-----------|--------|" >> $GITHUB_STEP_SUMMARY
147
+ echo "| GGScout Version | \`${{ github.event.inputs.ggscout_version }}\` |" >> $GITHUB_STEP_SUMMARY
148
+ echo "| Chart Increment | \`${{ github.event.inputs.chart_increment }}\` |" >> $GITHUB_STEP_SUMMARY
149
+ echo "| Updated App Version | ${{ github.event.inputs.update_app_version }} |" >> $GITHUB_STEP_SUMMARY
150
+ echo "" >> $GITHUB_STEP_SUMMARY
151
+ echo "### ✅ Completed Steps" >> $GITHUB_STEP_SUMMARY
152
+ echo "- Downloaded schemas from ggscout-repository" >> $GITHUB_STEP_SUMMARY
153
+ echo "- Updated bundled schema files" >> $GITHUB_STEP_SUMMARY
154
+ $(if [ '${{ github.event.inputs.update_app_version }}' = 'true' ]; then echo "- Updated Chart.yaml appVersion" >> $GITHUB_STEP_SUMMARY; fi)
155
+ echo "- Ran tests and linting" >> $GITHUB_STEP_SUMMARY
156
+ echo "- Created and pushed release" >> $GITHUB_STEP_SUMMARY
157
+ echo "" >> $GITHUB_STEP_SUMMARY
158
+ echo "🚀 **Chart release is now available!**" >> $GITHUB_STEP_SUMMARY
159
+
160
+ notify-completion :
161
+ needs : release
162
+ runs-on : ubuntu-latest
163
+ if : always()
164
+
165
+ steps :
166
+ - name : Notify completion
167
+ run : |
168
+ if [ "${{ needs.release.result }}" = "success" ]; then
169
+ echo "✅ Release workflow completed successfully!"
170
+ echo "The new Helm chart version with GGScout ${{ github.event.inputs.ggscout_version }} schemas is now available."
171
+ else
172
+ echo "❌ Release workflow failed!"
173
+ echo "Please check the logs above for error details."
174
+ fi
0 commit comments