Skip to content

Commit eadb161

Browse files
authored
docs: add latest documentation alias (#1243)
1 parent 6836c24 commit eadb161

7 files changed

Lines changed: 101 additions & 2 deletions

File tree

‎.agents/skills/release-a2a/SKILL.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ When applicable:
159159

160160
4. For Final releases: set the previous default version's `defaultVersion` to `false`.
161161

162+
The documentation deployment automatically exposes the version marked `defaultVersion: true` under `/latest/`, including Javadoc. Do not create or update a `docs/content/latest` directory during a release.
163+
162164
5. For pre-releases superseding a prior pre-release in the same X.Y.Z series: remove the old pre-release's content folder (`docs/content/<old-version_underscored>`), version yml (`docs/data/versions/<old-version>.yml`), and apidocs folder (`docs/public/<old-version_underscored>/apidocs/`).
163165

164166
6. Generate Javadoc. The `site-javadoc` profile outputs to `docs/public/dev/apidocs/`:
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
versions_dir=${1:?Usage: create-latest-alias.sh <versions-dir> <site-dir>}
6+
site_dir=${2:?Usage: create-latest-alias.sh <versions-dir> <site-dir>}
7+
latest_path=""
8+
9+
for version_file in "$versions_dir"/*.yml; do
10+
candidate=$(awk '
11+
$1 == "path:" {
12+
path = $2
13+
gsub(/^"|"$/, "", path)
14+
}
15+
$1 == "defaultVersion:" && $2 == "true" {
16+
default_version = 1
17+
}
18+
END {
19+
if (default_version && path != "") {
20+
print path
21+
}
22+
}
23+
' "$version_file")
24+
25+
if [[ -n "$candidate" ]]; then
26+
if [[ -n "$latest_path" ]]; then
27+
echo "Expected exactly one default documentation version" >&2
28+
exit 1
29+
fi
30+
latest_path="$candidate"
31+
fi
32+
done
33+
34+
if [[ -z "$latest_path" ]]; then
35+
echo "No default documentation version found" >&2
36+
exit 1
37+
fi
38+
39+
if [[ ! -d "$site_dir/$latest_path" ]]; then
40+
echo "Default documentation version is not present in the generated site: $latest_path" >&2
41+
exit 1
42+
fi
43+
44+
if [[ -e "$site_dir/latest" || -L "$site_dir/latest" ]]; then
45+
echo "Generated site already contains a latest alias" >&2
46+
exit 1
47+
fi
48+
49+
ln -s "$latest_path" "$site_dir/latest"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
6+
work_dir=$(mktemp -d)
7+
trap 'rm -rf "$work_dir"' EXIT
8+
9+
versions_dir="$work_dir/versions"
10+
site_dir="$work_dir/site"
11+
mkdir -p "$versions_dir" "$site_dir/1_4_0_Final/apidocs" "$site_dir/1_5_0_Final/apidocs"
12+
13+
cat > "$versions_dir/1.4.0.Final.yml" <<'EOF'
14+
path: "1_4_0_Final"
15+
defaultVersion: false
16+
EOF
17+
18+
cat > "$versions_dir/1.5.0.Final.yml" <<'EOF'
19+
path: "1_5_0_Final"
20+
defaultVersion: true
21+
EOF
22+
23+
"$script_dir/create-latest-alias.sh" "$versions_dir" "$site_dir"
24+
25+
test -L "$site_dir/latest"
26+
test "$(readlink "$site_dir/latest")" = "1_5_0_Final"
27+
test -d "$site_dir/latest/apidocs"

‎.github/workflows/check-site.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
13+
- name: Test latest documentation alias
14+
run: .github/scripts/test-create-latest-alias.sh
1315
- name: Generate Roq Site
1416
uses: quarkiverse/quarkus-roq@d0bdb4255f4dcc3ddd218c83f9dd19faa823ac31 # v1.1
1517
with:
1618
site-directory: ./docs/
1719
github-pages: 'false'
20+
- name: Verify latest documentation alias
21+
run: |
22+
.github/scripts/create-latest-alias.sh docs/data/versions docs/target/roq
23+
test -f docs/target/roq/latest/apidocs/index.html

‎.github/workflows/deploy-site.yml‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,26 @@ on:
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read # to check out the site sources
15+
pages: write # to upload the GitHub Pages artifact
16+
id-token: write # to verify the deployment originates from an appropriate source
1317
steps:
1418
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
1519
- name: Generate Roq Site
1620
uses: quarkiverse/quarkus-roq@d0bdb4255f4dcc3ddd218c83f9dd19faa823ac31 # v1.1
1721
with:
18-
github-token: ${{ secrets.GITHUB_TOKEN }} # Used to automatically get the GitHub Pages url
1922
site-directory: ./docs/
23+
github-pages: 'false'
24+
site-url: https://a2aproject.github.io/a2a-java
25+
- name: Create latest documentation alias
26+
run: .github/scripts/create-latest-alias.sh docs/data/versions docs/target/roq
27+
- name: Setup Pages
28+
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6
29+
- name: Upload GitHub Pages artifact
30+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
31+
with:
32+
path: docs/target/roq
2033
deploy:
2134
environment:
2235
name: github-pages

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Full documentation is available at **[a2aproject.github.io/a2a-java](https://a2a
1919

2020
- [Server Guide](https://a2aproject.github.io/a2a-java/server) — Run your agentic Java application as an A2A server
2121
- [Client Guide](https://a2aproject.github.io/a2a-java/client) — Communicate with any A2A-compliant agent
22-
- [Javadoc](https://a2aproject.github.io/a2a-java/1_3_0_Final/apidocs/) — Java API reference
22+
- [Javadoc](https://a2aproject.github.io/a2a-java/latest/apidocs/) — Java API reference
2323
- [Community Articles](https://a2aproject.github.io/a2a-java/community) — Tutorials, blog posts, and videos
2424
- [Announcements](https://a2aproject.github.io/a2a-java/announces) — Release announcements and project news
2525
- [Contributing](https://a2aproject.github.io/a2a-java/contributing) — Developer guide for contributing

‎RELEASE.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ Edit `docs/data/versions/X.Y.Z.Final.yml`:
184184
Update the previous default version's data file (e.g., `docs/data/versions/<previous-version>.yml`):
185185
- Set `defaultVersion` to `false`
186186

187+
The documentation deployment automatically exposes the version marked `defaultVersion: true` under `/latest/`, including Javadoc. Do not create or update a `docs/content/latest` directory during a release.
188+
187189
Review the new version's content for accuracy — ensure all pages reflect features available in this release.
188190

189191
#### Generate Javadoc (major/minor releases only)

0 commit comments

Comments
 (0)