Skip to content

Commit 968a084

Browse files
authored
build: Ensure provider metadata is up to date when releasing (#600)
When a new minor release is created, the metadata attached to the release needs to include the release series provider compatibility mapping. This commit ensures that if a new minor release is cut that the `metadata.yaml` attached to the release is cotrect for that release. I have manually fixed v0.8.1 and v0.7.0 releases and with this commit we won't need to do it manually ever again!
1 parent 6d18d4b commit 968a084

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ node_modules/
4343
/runtime-extension-components.yaml
4444
/_artifacts/
4545
test/e2e/config/caren-envsubst.yaml
46+
/release-metadata.yaml

.goreleaser.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ release:
2424
**Full Changelog**: https://github.com/nutanix-cloud-native/{{.ProjectName}}/compare/{{ .PreviousTag }}...{{ .Tag }}
2525
extra_files:
2626
- glob: ./examples/capi-quick-start/*.yaml
27-
- glob: metadata.yaml
27+
- glob: release-metadata.yaml
28+
name_template: metadata.yaml
2829
- glob: runtime-extension-components.yaml
2930

3031
before:
@@ -41,7 +42,11 @@ before:
4142
{{ if .IsSnapshot }}--set-string image.repository=ko.local/{{ .ProjectName }}{{ end }} \
4243
)
4344
EOF'
44-
- sed -i 's/\${/$${/g' runtime-extension-components.yaml
45+
- sed -i -e 's/\${/$${/g' -e 's/v0.0.0-dev/v{{ trimprefix .Version "v" }}/g' runtime-extension-components.yaml
46+
- |
47+
sh -ec 'gojq --yaml-input --yaml-output \
48+
".releaseSeries |= (. + [{contract: \"v1beta1\", major: {{ .Major }}, minor: {{ .Minor }}}] | unique)" \
49+
metadata.yaml >release-metadata.yaml'
4550
4651
builds:
4752
- id: cluster-api-runtime-extensions-nutanix

0 commit comments

Comments
 (0)