Skip to content

Commit 8b7f232

Browse files
authored
Prepare 0.14.0 release (#4413)
1 parent 19f22b8 commit 8b7f232

File tree

17 files changed

+271
-71
lines changed

17 files changed

+271
-71
lines changed

.github/workflows/gha-publish-chart.yaml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,21 @@ on:
2323
required: true
2424
type: boolean
2525
default: false
26+
publish_gha_runner_scale_set_controller_experimental_chart:
27+
description: "Publish new helm chart for gha-runner-scale-set-controller-experimental"
28+
required: true
29+
type: boolean
30+
default: false
2631
publish_gha_runner_scale_set_chart:
2732
description: "Publish new helm chart for gha-runner-scale-set"
2833
required: true
2934
type: boolean
3035
default: false
36+
publish_gha_runner_scale_set_experimental_chart:
37+
description: "Publish new helm chart for gha-runner-scale-set-experimental"
38+
required: true
39+
type: boolean
40+
default: false
3141

3242
env:
3343
HELM_VERSION: v3.8.0
@@ -159,6 +169,54 @@ jobs:
159169
echo "- Short SHA: ${{ steps.resolve_parameters.outputs.short_sha }}" >> $GITHUB_STEP_SUMMARY
160170
echo "- gha-runner-scale-set-controller Chart version: ${{ env.GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG }}" >> $GITHUB_STEP_SUMMARY
161171
172+
publish-helm-chart-gha-runner-scale-set-controller-experimental:
173+
if: ${{ inputs.publish_gha_runner_scale_set_controller_experimental_chart == true }}
174+
needs: build-push-image
175+
name: Publish Helm chart for gha-runner-scale-set-controller-experimental
176+
runs-on: ubuntu-latest
177+
steps:
178+
- name: Checkout
179+
uses: actions/checkout@v6
180+
with:
181+
# If inputs.ref is empty, it'll resolve to the default branch
182+
ref: ${{ inputs.ref }}
183+
184+
- name: Resolve parameters
185+
id: resolve_parameters
186+
run: |
187+
resolvedRef="${{ inputs.ref }}"
188+
if [ -z "$resolvedRef" ]
189+
then
190+
resolvedRef="${{ github.ref }}"
191+
fi
192+
echo "resolved_ref=$resolvedRef" >> $GITHUB_OUTPUT
193+
echo "INFO: Resolving short SHA for $resolvedRef"
194+
echo "short_sha=$(git rev-parse --short $resolvedRef)" >> $GITHUB_OUTPUT
195+
echo "INFO: Normalizing repository name (lowercase)"
196+
echo "repository_owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
197+
198+
- name: Set up Helm
199+
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4
200+
with:
201+
version: ${{ env.HELM_VERSION }}
202+
203+
- name: Publish new helm chart for gha-runner-scale-set-controller-experimental
204+
run: |
205+
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin
206+
GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG=$(cat charts/gha-runner-scale-set-controller-experimental/Chart.yaml | grep version: | cut -d " " -d '"' -f 2)
207+
echo "GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG=${GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG}" >> $GITHUB_ENV
208+
helm package charts/gha-runner-scale-set-controller-experimental/ --version="${GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG}"
209+
helm push gha-runner-scale-set-controller-experimental-"${GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG}".tgz oci://ghcr.io/${{ steps.resolve_parameters.outputs.repository_owner }}/actions-runner-controller-charts
210+
211+
- name: Job summary
212+
run: |
213+
echo "New helm chart for gha-runner-scale-set-controller-experimental published successfully!" >> $GITHUB_STEP_SUMMARY
214+
echo "" >> $GITHUB_STEP_SUMMARY
215+
echo "**Parameters:**" >> $GITHUB_STEP_SUMMARY
216+
echo "- Ref: ${{ steps.resolve_parameters.outputs.resolved_ref }}" >> $GITHUB_STEP_SUMMARY
217+
echo "- Short SHA: ${{ steps.resolve_parameters.outputs.short_sha }}" >> $GITHUB_STEP_SUMMARY
218+
echo "- gha-runner-scale-set-controller-experimental Chart version: ${{ env.GHA_RUNNER_SCALE_SET_CONTROLLER_CHART_VERSION_TAG }}" >> $GITHUB_STEP_SUMMARY
219+
162220
publish-helm-chart-gha-runner-scale-set:
163221
if: ${{ inputs.publish_gha_runner_scale_set_chart == true }}
164222
needs: build-push-image
@@ -206,3 +264,52 @@ jobs:
206264
echo "- Ref: ${{ steps.resolve_parameters.outputs.resolvedRef }}" >> $GITHUB_STEP_SUMMARY
207265
echo "- Short SHA: ${{ steps.resolve_parameters.outputs.short_sha }}" >> $GITHUB_STEP_SUMMARY
208266
echo "- gha-runner-scale-set Chart version: ${{ env.GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG }}" >> $GITHUB_STEP_SUMMARY
267+
268+
publish-helm-chart-gha-runner-scale-set-experimental:
269+
if: ${{ inputs.publish_gha_runner_scale_set_experimental_chart == true }}
270+
needs: build-push-image
271+
name: Publish Helm chart for gha-runner-scale-set-experimental
272+
runs-on: ubuntu-latest
273+
steps:
274+
- name: Checkout
275+
uses: actions/checkout@v6
276+
with:
277+
# If inputs.ref is empty, it'll resolve to the default branch
278+
ref: ${{ inputs.ref }}
279+
280+
- name: Resolve parameters
281+
id: resolve_parameters
282+
run: |
283+
resolvedRef="${{ inputs.ref }}"
284+
if [ -z "$resolvedRef" ]
285+
then
286+
resolvedRef="${{ github.ref }}"
287+
fi
288+
echo "resolved_ref=$resolvedRef" >> $GITHUB_OUTPUT
289+
echo "INFO: Resolving short SHA for $resolvedRef"
290+
echo "short_sha=$(git rev-parse --short $resolvedRef)" >> $GITHUB_OUTPUT
291+
echo "INFO: Normalizing repository name (lowercase)"
292+
echo "repository_owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
293+
294+
- name: Set up Helm
295+
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4
296+
with:
297+
version: ${{ env.HELM_VERSION }}
298+
299+
- name: Publish new helm chart for gha-runner-scale-set-experimental
300+
run: |
301+
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin
302+
303+
GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG=$(cat charts/gha-runner-scale-set-experimental/Chart.yaml | grep version: | cut -d " " -d '"' -f 2)
304+
echo "GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG=${GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG}" >> $GITHUB_ENV
305+
helm package charts/gha-runner-scale-set-experimental/ --version="${GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG}"
306+
helm push gha-runner-scale-set-experimental-"${GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG}".tgz oci://ghcr.io/${{ steps.resolve_parameters.outputs.repository_owner }}/actions-runner-controller-charts
307+
308+
- name: Job summary
309+
run: |
310+
echo "New helm chart for gha-runner-scale-set-experimental published successfully!" >> $GITHUB_STEP_SUMMARY
311+
echo "" >> $GITHUB_STEP_SUMMARY
312+
echo "**Parameters:**" >> $GITHUB_STEP_SUMMARY
313+
echo "- Ref: ${{ steps.resolve_parameters.outputs.resolved_ref }}" >> $GITHUB_STEP_SUMMARY
314+
echo "- Short SHA: ${{ steps.resolve_parameters.outputs.short_sha }}" >> $GITHUB_STEP_SUMMARY
315+
echo "- gha-runner-scale-set-experimental Chart version: ${{ env.GHA_RUNNER_SCALE_SET_CHART_VERSION_TAG }}" >> $GITHUB_STEP_SUMMARY

.github/workflows/gha-validate-chart.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,7 @@ jobs:
140140
run: go test ./charts/gha-runner-scale-set/...
141141
- name: Test gha-runner-scale-set-controller
142142
run: go test ./charts/gha-runner-scale-set-controller/...
143+
- name: Test gha-runner-scale-set-experimental
144+
run: go test ./charts/gha-runner-scale-set-experimental/...
145+
- name: Test gha-runner-scale-set-controller-experimental
146+
run: go test ./charts/gha-runner-scale-set-controller-experimental/...

charts/gha-runner-scale-set-controller-experimental/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.13.1
18+
version: 0.14.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "0.13.1"
24+
appVersion: "0.14.0"
2525

2626
home: https://github.com/actions/actions-runner-controller
2727

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package tests
2+
3+
import (
4+
"os"
5+
"path/filepath"
6+
"strings"
7+
"testing"
8+
9+
"github.com/gruntwork-io/terratest/modules/helm"
10+
"github.com/gruntwork-io/terratest/modules/k8s"
11+
"github.com/gruntwork-io/terratest/modules/logger"
12+
"github.com/gruntwork-io/terratest/modules/random"
13+
"github.com/stretchr/testify/assert"
14+
"github.com/stretchr/testify/require"
15+
"gopkg.in/yaml.v2"
16+
appsv1 "k8s.io/api/apps/v1"
17+
)
18+
19+
type Chart struct {
20+
Version string `yaml:"version"`
21+
AppVersion string `yaml:"appVersion"`
22+
}
23+
24+
func TestTemplate_RenderedDeployment_UsesChartMetadataLabels(t *testing.T) {
25+
t.Parallel()
26+
27+
helmChartPath, err := filepath.Abs("../../gha-runner-scale-set-controller-experimental")
28+
require.NoError(t, err)
29+
30+
chartContent, err := os.ReadFile(filepath.Join(helmChartPath, "Chart.yaml"))
31+
require.NoError(t, err)
32+
33+
chart := new(Chart)
34+
err = yaml.Unmarshal(chartContent, chart)
35+
require.NoError(t, err)
36+
37+
releaseName := "test-arc"
38+
namespaceName := "test-" + strings.ToLower(random.UniqueId())
39+
40+
options := &helm.Options{
41+
Logger: logger.Discard,
42+
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
43+
}
44+
45+
output := helm.RenderTemplate(t, options, helmChartPath, releaseName, []string{"templates/deployment.yaml"})
46+
47+
var deployment appsv1.Deployment
48+
helm.UnmarshalK8SYaml(t, output, &deployment)
49+
50+
assert.Equal(t, "gha-rs-controller-"+chart.Version, deployment.Labels["helm.sh/chart"])
51+
assert.Equal(t, chart.AppVersion, deployment.Labels["app.kubernetes.io/version"])
52+
}

charts/gha-runner-scale-set-controller/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.13.1
18+
version: 0.14.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "0.13.1"
24+
appVersion: "0.14.0"
2525

2626
home: https://github.com/actions/actions-runner-controller
2727

charts/gha-runner-scale-set-experimental/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: "0.13.1"
18+
version: "0.14.0"
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "0.13.1"
24+
appVersion: "0.14.0"
2525

2626
home: https://github.com/actions/actions-runner-controller
2727

charts/gha-runner-scale-set-experimental/tests/autoscaling_runner_set_labels_test.yaml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@ tests:
1212
release:
1313
name: "test-name"
1414
namespace: "test-namespace"
15-
chart:
16-
appVersion: "0.13.1"
1715
asserts:
18-
- equal:
19-
path: metadata.labels["helm.sh/chart"]
20-
value: "gha-rs-0.13.1"
2116
- equal:
2217
path: metadata.labels["app.kubernetes.io/name"]
2318
value: "test-name"
@@ -33,9 +28,9 @@ tests:
3328
- equal:
3429
path: metadata.labels["app.kubernetes.io/part-of"]
3530
value: "gha-rs"
36-
- equal:
31+
- notEqual:
3732
path: metadata.labels["app.kubernetes.io/version"]
38-
value: "0.13.1"
33+
value: ""
3934
- equal:
4035
path: metadata.labels["actions.github.com/scale-set-name"]
4136
value: "test-name"
@@ -66,9 +61,6 @@ tests:
6661
- equal:
6762
path: metadata.labels["environment"]
6863
value: "production"
69-
- equal:
70-
path: metadata.labels["helm.sh/chart"]
71-
value: "gha-rs-0.13.1"
7264
- equal:
7365
path: metadata.labels["app.kubernetes.io/name"]
7466
value: "test-name"
@@ -84,9 +76,9 @@ tests:
8476
- equal:
8577
path: metadata.labels["app.kubernetes.io/part-of"]
8678
value: "gha-rs"
87-
- equal:
79+
- notEqual:
8880
path: metadata.labels["app.kubernetes.io/version"]
89-
value: "0.13.1"
81+
value: ""
9082
- equal:
9183
path: metadata.labels["actions.github.com/scale-set-name"]
9284
value: "test-name"
@@ -117,9 +109,6 @@ tests:
117109
- equal:
118110
path: metadata.labels["owner"]
119111
value: "devops"
120-
- equal:
121-
path: metadata.labels["helm.sh/chart"]
122-
value: "gha-rs-0.13.1"
123112
- equal:
124113
path: metadata.labels["app.kubernetes.io/name"]
125114
value: "test-name"
@@ -135,9 +124,9 @@ tests:
135124
- equal:
136125
path: metadata.labels["app.kubernetes.io/part-of"]
137126
value: "gha-rs"
138-
- equal:
127+
- notEqual:
139128
path: metadata.labels["app.kubernetes.io/version"]
140-
value: "0.13.1"
129+
value: ""
141130
- equal:
142131
path: metadata.labels["actions.github.com/scale-set-name"]
143132
value: "test-name"
@@ -176,9 +165,6 @@ tests:
176165
- equal:
177166
path: metadata.labels["environment"]
178167
value: "staging"
179-
- equal:
180-
path: metadata.labels["helm.sh/chart"]
181-
value: "gha-rs-0.13.1"
182168
- equal:
183169
path: metadata.labels["app.kubernetes.io/name"]
184170
value: "test-name"
@@ -194,9 +180,9 @@ tests:
194180
- equal:
195181
path: metadata.labels["app.kubernetes.io/part-of"]
196182
value: "gha-rs"
197-
- equal:
183+
- notEqual:
198184
path: metadata.labels["app.kubernetes.io/version"]
199-
value: "0.13.1"
185+
value: ""
200186
- equal:
201187
path: metadata.labels["actions.github.com/scale-set-name"]
202188
value: "test-name"

charts/gha-runner-scale-set-experimental/tests/autoscaling_runner_set_runner_pod_metadata_test.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,19 @@ tests:
2626
release:
2727
name: "test-name"
2828
namespace: "test-namespace"
29-
chart:
30-
appVersion: "0.13.1"
3129
asserts:
3230
- equal:
3331
path: spec.template.metadata.labels["purpose"]
3432
value: "ci"
3533
- equal:
3634
path: spec.template.metadata.labels["team"]
3735
value: "platform"
38-
- equal:
39-
path: spec.template.metadata.labels["helm.sh/chart"]
40-
value: "gha-rs-0.13.1"
4136
- equal:
4237
path: spec.template.metadata.labels["app.kubernetes.io/name"]
4338
value: "test-name"
39+
- notEqual:
40+
path: spec.template.metadata.labels["app.kubernetes.io/version"]
41+
value: ""
4442
- equal:
4543
path: spec.template.metadata.labels["app.kubernetes.io/managed-by"]
4644
value: "Helm"

charts/gha-runner-scale-set-experimental/tests/github_secret_labels_test.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@ tests:
1010
release:
1111
name: "test-name"
1212
namespace: "test-namespace"
13-
chart:
14-
appVersion: "0.13.1"
1513
asserts:
16-
- equal:
17-
path: metadata.labels["helm.sh/chart"]
18-
value: "gha-rs-0.13.1"
1914
- equal:
2015
path: metadata.labels["app.kubernetes.io/name"]
2116
value: "test-name"
@@ -31,9 +26,9 @@ tests:
3126
- equal:
3227
path: metadata.labels["app.kubernetes.io/part-of"]
3328
value: "gha-rs"
34-
- equal:
29+
- notEqual:
3530
path: metadata.labels["app.kubernetes.io/version"]
36-
value: "0.13.1"
31+
value: ""
3732
- equal:
3833
path: metadata.labels["actions.github.com/scale-set-name"]
3934
value: "test-name"
@@ -109,9 +104,9 @@ tests:
109104
name: "test-name"
110105
namespace: "test-namespace"
111106
asserts:
112-
- equal:
107+
- notEqual:
113108
path: metadata.labels["helm.sh/chart"]
114-
value: "gha-rs-0.13.1"
109+
value: "bad"
115110
- equal:
116111
path: metadata.labels["app.kubernetes.io/name"]
117112
value: "test-name"

0 commit comments

Comments
 (0)