1+ # Check the documentation at https://goreleaser.com
2+
3+ # yaml-language-server: $schema=https://goreleaser.com/static/schema.json
4+ # vim: set ts=2 sw=2 tw=0 fo=cnqoj
5+
6+ version : 2
7+
8+ # Prepare files for the release
9+ before :
10+ hooks :
11+ - go mod tidy
12+ # Ensures k8s/ manifests are up-to-date
13+ - go generate ./...
14+ # Prepares the final release manifests
15+ - |
16+ sh -c "
17+ set -e;
18+ mkdir -p release_assets;
19+
20+ # All .yaml files within the k8s/ directory that DO NOT start with 'extensions' are core.
21+ echo 'INFO: Preparing core manifest.yaml';
22+ find k8s -type f -name '*.yaml' -and -not -name 'extensions*' | xargs cat > ./release_assets/manifest.yaml;
23+
24+ # Construct the image URL using the Git tag.
25+ # Note: this requires the image to have been promoted staging manually, after the Git tag is created.
26+ IMAGE_URL='registry.k8s.io/agent-sandbox/agent-sandbox-controller:{{.Tag}}';
27+
28+ echo 'INFO: Replacing image placeholder in core manifest.yaml with: $IMAGE_URL';
29+ sed -i 's|ko://sigs.k8s.io/agent-sandbox/cmd/agent-sandbox-controller.*|'$IMAGE_URL'|' ./release_assets/manifest.yaml;
30+ echo 'INFO: Successfully created release_assets/manifest.yaml';
31+
32+ # All .yaml files within the k8s/ directory that start with 'extensions' are extensions.
33+ echo 'INFO: Preparing extensions.yaml';
34+ find k8s -type f -name 'extensions*.yaml' | xargs cat > ./release_assets/extensions.yaml;
35+ echo 'INFO: Successfully created release_assets/extensions.yaml';
36+ "
37+
38+ # Skipping the build step, as images are built and promoted separately.
39+ builds :
40+ - skip : true
41+
42+ release :
43+ github :
44+ owner : kubernetes-sigs
45+ name : agent-sandbox
46+
47+ # Create a draft release for manual verification before publishing.
48+ draft : true
49+
50+ # Automatically mark releases from tags like 'v0.1.0-rc.1' as a "Pre-release".
51+ prerelease : auto
52+
53+ # GoReleaser will find these files (prepared by the 'before' hook)
54+ # and attach them as assets to the GitHub Release.
55+ extra_files :
56+ - glob : ./release_assets/manifest.yaml
57+ name_template : " manifest.yaml"
58+ - glob : ./release_assets/extensions.yaml
59+ name_template : " extensions.yaml"
60+
61+ changelog :
62+ sort : asc
63+ filters :
64+ exclude :
65+ # Excludes commits that start with 'docs:' or 'test:'
66+ - ' ^docs:'
67+ - ' ^test:'
0 commit comments