@@ -80,13 +80,25 @@ jobs:
8080 echo "Compiling Java source from tag ${{ inputs.monorepo_tag }}"
8181 mvn clean compile test -DskipTests=false -Dcheckstyle.skip=true -B
8282
83- # 5. Build the Maven Site using THIS repo's pom.xml + src/site/
83+ # 5. Update hardcoded version strings in site content
84+ # Cookbook files and other markdown pages embed JBang //DEPS lines with
85+ # hardcoded artifact versions for direct browsing on GitHub. Update them
86+ # to the version being released. (${project.version} references are
87+ # handled by Maven resource filtering during mvn site.)
88+ - name : Update version strings in site content
89+ run : |
90+ VERSION="${{ inputs.version }}"
91+ echo "Updating copilot-sdk-java version references to ${VERSION}"
92+ find src/site/markdown -name "*.md" -type f -exec \
93+ sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*|copilot-sdk-java:${VERSION}|g" {} \;
94+
95+ # 6. Build the Maven Site using THIS repo's pom.xml + src/site/
8496 - name : Build documentation site
8597 run : |
8698 echo "Building site for version ${{ inputs.version }}"
8799 mvn site -Dsite.version=${{ inputs.version }} -B
88100
89- # 6 . Prepare gh-pages deployment directory
101+ # 7 . Prepare gh-pages deployment directory
90102 - name : Prepare gh-pages directory
91103 run : |
92104 # Try to clone existing gh-pages branch (shallow)
@@ -100,7 +112,7 @@ jobs:
100112 git checkout -b gh-pages
101113 }
102114
103- # 7 . Copy generated site to version directory
115+ # 8 . Copy generated site to version directory
104116 - name : Deploy version documentation
105117 run : |
106118 VERSION="${{ inputs.version }}"
@@ -117,13 +129,13 @@ jobs:
117129 cp -r target/site/* "site/latest/"
118130 fi
119131
120- # 8 . Copy version index page from templates
132+ # 9 . Copy version index page from templates
121133 - name : Copy version index page
122134 run : |
123135 cp .github/templates/index.html site/index.html
124136 cp .github/templates/styles.css site/styles.css
125137
126- # 9 . Update version list based on directories present in gh-pages
138+ # 10 . Update version list based on directories present in gh-pages
127139 - name : Update version list from deployed directories
128140 run : |
129141 cd site
@@ -168,7 +180,7 @@ jobs:
168180 sed -i "s|<!-- OLDER_VERSIONS_PLACEHOLDER -->|$OLDER_HTML|" index.html
169181 sed -i "s|<!-- COMMUNITY_VERSIONS_PLACEHOLDER -->|$COMMUNITY_HTML|" index.html
170182
171- # 10 . Overlay custom JaCoCo CSS
183+ # 11 . Overlay custom JaCoCo CSS
172184 - name : Overlay custom JaCoCo CSS
173185 run : |
174186 cd site
@@ -182,7 +194,7 @@ jobs:
182194 done
183195 fi
184196
185- # 11 . Push to gh-pages
197+ # 12 . Push to gh-pages
186198 - name : Deploy to GitHub Pages
187199 run : |
188200 cd site
0 commit comments