Skip to content

Commit c8f4ba2

Browse files
Merge branch 'main' into main
2 parents 542f8ec + 57c900b commit c8f4ba2

File tree

106 files changed

+2791
-789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+2791
-789
lines changed

.github/scripts/tag_release.sh

Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
#!/bin/bash
2+
3+
# Tag Release Script
4+
# Automatically detects modules that need tagging and creates release tags
5+
# Usage: ./tag_release.sh
6+
# Operates on the current checked-out commit
7+
8+
set -euo pipefail
9+
10+
MODULES_TO_TAG=()
11+
12+
usage() {
13+
echo "Usage: $0"
14+
echo ""
15+
echo "This script will:"
16+
echo " 1. Scan all modules in the registry"
17+
echo " 2. Check which modules need new release tags"
18+
echo " 3. Extract version information from README files"
19+
echo " 4. Generate a report for confirmation"
20+
echo " 5. Create and push release tags after confirmation"
21+
echo ""
22+
echo "The script operates on the current checked-out commit."
23+
echo "Make sure you have checked out the commit you want to tag before running."
24+
exit 1
25+
}
26+
27+
validate_version() {
28+
local version="$1"
29+
if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
30+
echo "❌ Invalid version format: '$version'. Expected X.Y.Z format." >&2
31+
return 1
32+
fi
33+
return 0
34+
}
35+
36+
extract_version_from_readme() {
37+
local readme_path="$1"
38+
local namespace="$2"
39+
local module_name="$3"
40+
41+
[ ! -f "$readme_path" ] && return 1
42+
43+
local version_line
44+
version_line=$(grep -E "source\s*=\s*\"registry\.coder\.com/${namespace}/${module_name}" "$readme_path" | head -1 || echo "")
45+
46+
if [ -n "$version_line" ]; then
47+
local version
48+
version=$(echo "$version_line" | sed -n 's/.*version\s*=\s*"\([^"]*\)".*/\1/p')
49+
if [ -n "$version" ]; then
50+
echo "$version"
51+
return 0
52+
fi
53+
fi
54+
55+
local fallback_version
56+
fallback_version=$(grep -E 'version\s*=\s*"[0-9]+\.[0-9]+\.[0-9]+"' "$readme_path" | head -1 | sed 's/.*version\s*=\s*"\([^"]*\)".*/\1/' || echo "")
57+
58+
if [ -n "$fallback_version" ]; then
59+
echo "$fallback_version"
60+
return 0
61+
fi
62+
63+
return 1
64+
}
65+
66+
check_module_needs_tagging() {
67+
local namespace="$1"
68+
local module_name="$2"
69+
local readme_version="$3"
70+
71+
local tag_name="release/${namespace}/${module_name}/v${readme_version}"
72+
73+
if git rev-parse --verify "$tag_name" > /dev/null 2>&1; then
74+
return 1
75+
else
76+
return 0
77+
fi
78+
}
79+
80+
detect_modules_needing_tags() {
81+
MODULES_TO_TAG=()
82+
83+
echo "🔍 Scanning all modules for missing release tags..."
84+
echo ""
85+
86+
local all_modules
87+
all_modules=$(find registry -mindepth 3 -maxdepth 3 -type d -path "*/modules/*" | sort -u || echo "")
88+
89+
[ -z "$all_modules" ] && {
90+
echo "❌ No modules found to check"
91+
return 1
92+
}
93+
94+
local total_checked=0
95+
local needs_tagging=0
96+
97+
while IFS= read -r module_path; do
98+
if [ -z "$module_path" ]; then continue; fi
99+
100+
local namespace
101+
namespace=$(echo "$module_path" | cut -d'/' -f2)
102+
local module_name
103+
module_name=$(echo "$module_path" | cut -d'/' -f4)
104+
105+
total_checked=$((total_checked + 1))
106+
107+
local readme_path="$module_path/README.md"
108+
local readme_version
109+
110+
if ! readme_version=$(extract_version_from_readme "$readme_path" "$namespace" "$module_name"); then
111+
echo "⚠️ $namespace/$module_name: No version found in README, skipping"
112+
continue
113+
fi
114+
115+
if ! validate_version "$readme_version"; then
116+
echo "⚠️ $namespace/$module_name: Invalid version format '$readme_version', skipping"
117+
continue
118+
fi
119+
120+
if check_module_needs_tagging "$namespace" "$module_name" "$readme_version"; then
121+
echo "📦 $namespace/$module_name: v$readme_version (needs tag)"
122+
MODULES_TO_TAG+=("$module_path:$namespace:$module_name:$readme_version")
123+
needs_tagging=$((needs_tagging + 1))
124+
else
125+
echo "$namespace/$module_name: v$readme_version (already tagged)"
126+
fi
127+
128+
done <<< "$all_modules"
129+
130+
echo ""
131+
echo "📊 Summary: $needs_tagging of $total_checked modules need tagging"
132+
echo ""
133+
134+
[ $needs_tagging -eq 0 ] && {
135+
echo "🎉 All modules are up to date! No tags needed."
136+
return 0
137+
}
138+
139+
echo "## Tags to be created:"
140+
for module_info in "${MODULES_TO_TAG[@]}"; do
141+
IFS=':' read -r module_path namespace module_name version <<< "$module_info"
142+
echo "- \`release/$namespace/$module_name/v$version\`"
143+
done
144+
echo ""
145+
146+
return 0
147+
}
148+
149+
create_and_push_tags() {
150+
[ ${#MODULES_TO_TAG[@]} -eq 0 ] && {
151+
echo "❌ No modules to tag found"
152+
return 1
153+
}
154+
155+
local current_commit
156+
current_commit=$(git rev-parse HEAD)
157+
158+
echo "🏷️ Creating release tags for commit: $current_commit"
159+
echo ""
160+
161+
local created_tags=0
162+
local failed_tags=0
163+
164+
for module_info in "${MODULES_TO_TAG[@]}"; do
165+
IFS=':' read -r module_path namespace module_name version <<< "$module_info"
166+
167+
local tag_name="release/$namespace/$module_name/v$version"
168+
local tag_message="Release $namespace/$module_name v$version"
169+
170+
echo "Creating tag: $tag_name"
171+
172+
if git tag -a "$tag_name" -m "$tag_message" "$current_commit"; then
173+
echo "✅ Created: $tag_name"
174+
created_tags=$((created_tags + 1))
175+
else
176+
echo "❌ Failed to create: $tag_name"
177+
failed_tags=$((failed_tags + 1))
178+
fi
179+
done
180+
181+
echo ""
182+
echo "📊 Tag creation summary:"
183+
echo " Created: $created_tags"
184+
echo " Failed: $failed_tags"
185+
echo ""
186+
187+
[ $created_tags -eq 0 ] && {
188+
echo "❌ No tags were created successfully"
189+
return 1
190+
}
191+
192+
echo "🚀 Pushing tags to origin..."
193+
194+
local tags_to_push=()
195+
for module_info in "${MODULES_TO_TAG[@]}"; do
196+
IFS=':' read -r module_path namespace module_name version <<< "$module_info"
197+
local tag_name="release/$namespace/$module_name/v$version"
198+
199+
if git rev-parse --verify "$tag_name" > /dev/null 2>&1; then
200+
tags_to_push+=("$tag_name")
201+
fi
202+
done
203+
204+
local pushed_tags=0
205+
local failed_pushes=0
206+
207+
if [ ${#tags_to_push[@]} -eq 0 ]; then
208+
echo "❌ No valid tags found to push"
209+
else
210+
if git push --atomic origin "${tags_to_push[@]}"; then
211+
echo "✅ Successfully pushed all ${#tags_to_push[@]} tags"
212+
pushed_tags=${#tags_to_push[@]}
213+
else
214+
echo "❌ Failed to push tags"
215+
failed_pushes=${#tags_to_push[@]}
216+
fi
217+
fi
218+
219+
echo ""
220+
echo "📊 Push summary:"
221+
echo " Pushed: $pushed_tags"
222+
echo " Failed: $failed_pushes"
223+
echo ""
224+
225+
if [ $pushed_tags -gt 0 ]; then
226+
echo "🎉 Successfully created and pushed $pushed_tags release tags!"
227+
echo ""
228+
echo "📝 Next steps:"
229+
echo " - Tags will be automatically published to registry.coder.com"
230+
echo " - Monitor the registry website for updates"
231+
echo " - Check GitHub releases for any issues"
232+
fi
233+
234+
return 0
235+
}
236+
237+
main() {
238+
[ $# -gt 0 ] && usage
239+
240+
echo "🚀 Coder Registry Tag Release Script"
241+
echo "Operating on commit: $(git rev-parse HEAD)"
242+
echo ""
243+
244+
if ! git rev-parse --git-dir > /dev/null 2>&1; then
245+
echo "❌ Not in a git repository"
246+
exit 1
247+
fi
248+
249+
detect_modules_needing_tags || exit 1
250+
251+
[ ${#MODULES_TO_TAG[@]} -eq 0 ] && {
252+
echo "✨ No modules need tagging. All done!"
253+
exit 0
254+
}
255+
256+
echo ""
257+
echo "❓ Do you want to proceed with creating and pushing these release tags?"
258+
echo " This will create git tags and push them to the remote repository."
259+
echo ""
260+
read -p "Continue? [y/N]: " -r response
261+
262+
case "$response" in
263+
[yY] | [yY][eE][sS])
264+
echo ""
265+
create_and_push_tags
266+
;;
267+
*)
268+
echo ""
269+
echo "🚫 Operation cancelled by user"
270+
exit 0
271+
;;
272+
esac
273+
}
274+
275+
main "$@"

.github/workflows/deploy-registry.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: deploy-registry
22

33
on:
4+
schedule:
5+
# Runs at 02:30 UTC Monday through Friday
6+
- cron: "30 2 * * 1-5"
47
push:
58
tags:
69
# Matches release/<namespace>/<resource_name>/<semantic_version>
@@ -26,12 +29,12 @@ jobs:
2629
- name: Checkout code
2730
uses: actions/checkout@v4
2831
- name: Authenticate with Google Cloud
29-
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193
32+
uses: google-github-actions/auth@b7593ed2efd1c1617e1b0254da33b86225adb2a5
3033
with:
3134
workload_identity_provider: projects/309789351055/locations/global/workloadIdentityPools/github-actions/providers/github
3235
service_account: [email protected]
3336
- name: Set up Google Cloud SDK
34-
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a
37+
uses: google-github-actions/setup-gcloud@6a7c903a70c8625ed6700fa299f5ddb4ca6022e9
3538
- name: Deploy to dev.registry.coder.com
3639
run: gcloud builds triggers run 29818181-126d-4f8a-a937-f228b27d3d34 --branch main
3740
- name: Deploy to registry.coder.com

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,6 @@ dist
145145

146146
# Generated credentials from google-github-actions/auth
147147
gha-creds-*.json
148+
149+
# IDEs
150+
.idea

.icons/gemini.svg

Lines changed: 1 addition & 0 deletions
Loading

.icons/kiro.svg

Lines changed: 1 addition & 0 deletions
Loading

.icons/tmux.svg

Lines changed: 1 addition & 0 deletions
Loading

MAINTAINER.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ Changes are automatically published to [registry.coder.com](https://registry.cod
7272
display_name: "Module Name"
7373
description: "What it does"
7474
icon: "../../../../.icons/tool.svg"
75-
maintainer_github: "username"
76-
partner_github: "partner-name" # Optional - For official partner modules
7775
verified: false # Optional - Set by maintainers only
7876
tags: ["tag1", "tag2"]
7977
```

bun.lock

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"lockfileVersion": 1,
3+
"workspaces": {
4+
"": {
5+
"name": "registry",
6+
"devDependencies": {
7+
"@types/bun": "^1.2.18",
8+
"bun-types": "^1.2.18",
9+
"dedent": "^1.6.0",
10+
"gray-matter": "^4.0.3",
11+
"marked": "^16.0.0",
12+
"prettier": "^3.6.2",
13+
"prettier-plugin-sh": "^0.18.0",
14+
"prettier-plugin-terraform-formatter": "^1.2.1",
15+
},
16+
"peerDependencies": {
17+
"typescript": "^5.8.3",
18+
},
19+
},
20+
},
21+
"packages": {
22+
"@reteps/dockerfmt": ["@reteps/[email protected]", "", {}, "sha512-Tb5wIMvBf/nLejTQ61krK644/CEMB/cpiaIFXqGApfGqO3GwcR3qnI0DbmkFVCl2OyEp8LnLX3EkucoL0+tbFg=="],
23+
24+
"@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.2.18" } }, "sha512-Xf6RaWVheyemaThV0kUfaAUvCNokFr+bH8Jxp+tTZfx7dAPA8z9ePnP9S9+Vspzuxxx9JRAXhnyccRj3GyCMdQ=="],
25+
26+
"@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~7.8.0" } }, "sha512-4zXMWD91vBLGRtHK3YbIoFMia+1nqEz72coM42C5ETjnNCa/heoj7NT1G67iAfOqMmcfhuCZ4uNpyz8EjlAejw=="],
27+
28+
"@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g=="],
29+
30+
"argparse": ["[email protected]", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="],
31+
32+
"bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-04+Eha5NP7Z0A9YgDAzMk5PHR16ZuLVa83b26kH5+cp1qZW4F6FmAURngE7INf4tKOvCE69vYvDEwoNl1tGiWw=="],
33+
34+
"csstype": ["[email protected]", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
35+
36+
"dedent": ["[email protected]", "", { "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, "optionalPeers": ["babel-plugin-macros"] }, "sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA=="],
37+
38+
"esprima": ["[email protected]", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="],
39+
40+
"extend-shallow": ["[email protected]", "", { "dependencies": { "is-extendable": "^0.1.0" } }, "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug=="],
41+
42+
"gray-matter": ["[email protected]", "", { "dependencies": { "js-yaml": "^3.13.1", "kind-of": "^6.0.2", "section-matter": "^1.0.0", "strip-bom-string": "^1.0.0" } }, "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q=="],
43+
44+
"is-extendable": ["[email protected]", "", {}, "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw=="],
45+
46+
"js-yaml": ["[email protected]", "", { "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g=="],
47+
48+
"kind-of": ["[email protected]", "", {}, "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw=="],
49+
50+
"marked": ["[email protected]", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-MUKMXDjsD/eptB7GPzxo4xcnLS6oo7/RHimUMHEDRhUooPwmN9BEpMl7AEOJv3bmso169wHI2wUF9VQgL7zfmA=="],
51+
52+
"prettier": ["[email protected]", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ=="],
53+
54+
"prettier-plugin-sh": ["[email protected]", "", { "dependencies": { "@reteps/dockerfmt": "^0.3.6", "sh-syntax": "^0.5.8" }, "peerDependencies": { "prettier": "^3.6.0" } }, "sha512-cW1XL27FOJQ/qGHOW6IHwdCiNWQsAgK+feA8V6+xUTaH0cD3Mh+tFAtBvEEWvuY6hTDzRV943Fzeii+qMOh7nQ=="],
55+
56+
"prettier-plugin-terraform-formatter": ["[email protected]", "", { "peerDependencies": { "prettier": ">= 1.16.0" }, "optionalPeers": ["prettier"] }, "sha512-rdzV61Bs/Ecnn7uAS/vL5usTX8xUWM+nQejNLZxt3I1kJH5WSeLEmq7LYu1wCoEQF+y7Uv1xGvPRfl3lIe6+tA=="],
57+
58+
"section-matter": ["[email protected]", "", { "dependencies": { "extend-shallow": "^2.0.1", "kind-of": "^6.0.0" } }, "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA=="],
59+
60+
"sh-syntax": ["[email protected]", "", { "dependencies": { "tslib": "^2.8.1" } }, "sha512-JfVoxf4FxQI5qpsPbkHhZo+n6N9YMJobyl4oGEUBb/31oQYlgTjkXQD8PBiafS2UbWoxrTO0Z5PJUBXEPAG1Zw=="],
61+
62+
"sprintf-js": ["[email protected]", "", {}, "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="],
63+
64+
"strip-bom-string": ["[email protected]", "", {}, "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g=="],
65+
66+
"tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
67+
68+
"typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="],
69+
70+
"undici-types": ["[email protected]", "", {}, "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="],
71+
}
72+
}

bun.lockb

-9.99 KB
Binary file not shown.

0 commit comments

Comments
 (0)