Skip to content

Commit 1c194ce

Browse files
edburnsCopilot
andcommitted
Restructure version index: current, older releases, community releases
- Current version: whatever is passed to the workflow (shown with 'latest' badge) - Older releases: previous monorepo-era releases (initially empty) - Community releases: pre-monorepo versions (1.0.9 and below) - Remove 'Development (main branch)' snapshot entry - Remove snapshot legend item - Update all GitHub links to point to monorepo Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 311c5b2 commit 1c194ce

2 files changed

Lines changed: 42 additions & 24 deletions

File tree

.github/templates/index.html

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ <h1>GitHub Copilot SDK for <span class="gradient-text">Java</span></h1>
3737
</div>
3838

3939
<div class="section">
40-
<h2 class="section-title">Available Versions</h2>
40+
<h2 class="section-title">Available versions</h2>
4141
<ul class="version-list">
42-
<!-- CURRENT_VERSIONS_PLACEHOLDER -->
42+
<!-- CURRENT_VERSION_PLACEHOLDER -->
4343
</ul>
4444

4545
<div class="collapsible">
4646
<button class="collapsible-toggle" onclick="this.classList.toggle('open'); this.nextElementSibling.classList.toggle('open');">
47-
Older Releases
47+
Older releases
4848
</button>
4949
<div class="collapsible-content">
5050
<ul class="older-list">
@@ -53,15 +53,22 @@ <h2 class="section-title">Available Versions</h2>
5353
</div>
5454
</div>
5555

56+
<div class="collapsible">
57+
<button class="collapsible-toggle" onclick="this.classList.toggle('open'); this.nextElementSibling.classList.toggle('open');">
58+
Community releases
59+
</button>
60+
<div class="collapsible-content">
61+
<ul class="older-list">
62+
<!-- COMMUNITY_VERSIONS_PLACEHOLDER -->
63+
</ul>
64+
</div>
65+
</div>
66+
5667
<div class="legend">
5768
<div class="legend-item">
5869
<div class="legend-color latest"></div>
5970
<span>Latest stable release</span>
6071
</div>
61-
<div class="legend-item">
62-
<div class="legend-color snapshot"></div>
63-
<span>Development snapshot</span>
64-
</div>
6572
</div>
6673
</div>
6774

.github/workflows/deploy-site.yml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,33 +129,44 @@ jobs:
129129
cd site
130130
131131
MONOREPO_URL="https://github.com/github/copilot-sdk"
132-
STANDALONE_URL="https://github.com/github/copilot-sdk-java"
132+
CURRENT_VERSION="${{ inputs.version }}"
133133
134-
VERSIONS=$(ls -d */ 2>/dev/null | sed 's|/||' | grep -E '^[0-9]+\.[0-9]+' | sort -Vr || true)
134+
# Community releases: versions that existed before the monorepo era.
135+
# These are all versions that are NOT the current deploy version.
136+
# They go into the "Community releases" collapsible section.
137+
COMMUNITY_VERSIONS="1.0.9 1.0.8 1.0.7 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0-beta-java.4 1.0.0-beta-java.3 1.0.0-beta-java.2 1.0.0-beta-java.1 1.0.0-beta-10-java.0 1.0.0-beta-8-java.0 0.3.0-java.2"
138+
STANDALONE_URL="https://github.com/github/copilot-sdk-java"
135139
136-
HAS_SNAPSHOT=$([ -d "snapshot" ] && echo "true" || echo "false")
140+
# Current version (the one just deployed)
141+
CURRENT_HTML='<li class="latest-version"><span class="version-name">Version '"${CURRENT_VERSION}"'</span><span class="version-links"><a href="./'"${CURRENT_VERSION}"'/" class="doc-link">documentation ↗</a><a href="'"${MONOREPO_URL}"'/releases/tag/java/v'"${CURRENT_VERSION}"'" class="release-link">release notes ↗</a><span class="badge latest">latest</span></span></li>'
137142
138-
CURRENT_HTML=""
143+
# Older releases: previous monorepo releases (all version dirs that
144+
# are NOT the current version and NOT in the community list)
139145
OLDER_HTML=""
140-
IS_FIRST_VERSION="true"
141-
142-
if [ "$HAS_SNAPSHOT" = "true" ]; then
143-
CURRENT_HTML+='<li><span class="version-name">Development (main branch)</span><span class="version-links"><a href="./snapshot/" class="doc-link">documentation ↗</a><a href="'"${MONOREPO_URL}"'/blob/main/java/CHANGELOG.md" class="release-link">changelog ↗</a><span class="badge snapshot">snapshot</span></span></li>'
144-
fi
145-
146-
for v in $VERSIONS; do
146+
ALL_VERSIONS=$(ls -d */ 2>/dev/null | sed 's|/||' | grep -E '^[0-9]+\.[0-9]+' | sort -Vr || true)
147+
for v in $ALL_VERSIONS; do
148+
# Skip current version
149+
[[ "$v" == "$CURRENT_VERSION" ]] && continue
150+
# Skip community versions
151+
echo "$COMMUNITY_VERSIONS" | tr ' ' '\n' | grep -qx "$v" && continue
152+
# Skip snapshot/latest dirs
153+
[[ "$v" == "snapshot" || "$v" == "latest" ]] && continue
147154
RELEASE_URL="${MONOREPO_URL}/releases/tag/java/v${v}"
155+
OLDER_HTML+='<li><span>'"$v"'</span><span class="older-links"><a href="./'"$v"'/" class="doc-link">documentation ↗</a><a href="'"$RELEASE_URL"'" class="release-link">release notes ↗</a></span></li>'
156+
done
148157
149-
if [ "$IS_FIRST_VERSION" = "true" ]; then
150-
CURRENT_HTML+='<li class="latest-version"><span class="version-name">Version '"$v"'</span><span class="version-links"><a href="./'"$v"'/" class="doc-link">documentation ↗</a><a href="'"$RELEASE_URL"'" class="release-link">release notes ↗</a><span class="badge latest">latest</span></span></li>'
151-
IS_FIRST_VERSION="false"
152-
else
153-
OLDER_HTML+='<li><span>'"$v"'</span><span class="older-links"><a href="./'"$v"'/" class="doc-link">documentation ↗</a><a href="'"$RELEASE_URL"'" class="release-link">release notes ↗</a></span></li>'
158+
# Community releases
159+
COMMUNITY_HTML=""
160+
for v in $COMMUNITY_VERSIONS; do
161+
if [ -d "$v" ]; then
162+
RELEASE_URL="${STANDALONE_URL}/releases/tag/v${v}"
163+
COMMUNITY_HTML+='<li><span>'"$v"'</span><span class="older-links"><a href="./'"$v"'/" class="doc-link">documentation ↗</a><a href="'"$RELEASE_URL"'" class="release-link">release notes ↗</a></span></li>'
154164
fi
155165
done
156166
157-
sed -i "s|<!-- CURRENT_VERSIONS_PLACEHOLDER -->|$CURRENT_HTML|" index.html
167+
sed -i "s|<!-- CURRENT_VERSION_PLACEHOLDER -->|$CURRENT_HTML|" index.html
158168
sed -i "s|<!-- OLDER_VERSIONS_PLACEHOLDER -->|$OLDER_HTML|" index.html
169+
sed -i "s|<!-- COMMUNITY_VERSIONS_PLACEHOLDER -->|$COMMUNITY_HTML|" index.html
159170
160171
# 10. Overlay custom JaCoCo CSS
161172
- name: Overlay custom JaCoCo CSS

0 commit comments

Comments
 (0)