Skip to content

Commit f3a80da

Browse files
authored
Merge pull request #4191 from ralfhandl/main-spec-minor-version-symlinks
respec workflow: create symlinks for spec minor versions
2 parents 50103d8 + 362e974 commit f3a80da

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

scripts/md2html/build.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,29 @@ cp -p ../../node_modules/respec/builds/respec-w3c.* ../../deploy/js/
4040

4141
latest=`git describe --abbrev=0 --tags`
4242
latestCopied=none
43-
for filename in ../../versions/[23456789].*.md ; do
43+
lastMinor="-"
44+
for filename in $(ls -1 ../../versions/[23456789].*.md | sort -r) ; do
4445
version=$(basename "$filename" .md)
46+
minorVersion=${version:0:3}
4547
tempfile=../../deploy/oas/v$version-tmp.html
4648
echo -e "\n=== v$version ==="
49+
4750
node md2html.js --maintainers ./history/MAINTAINERS_v$version.md ${filename} > $tempfile
4851
npx respec --use-local --src $tempfile --out ../../deploy/oas/v$version.html
4952
rm $tempfile
53+
5054
if [ $version = $latest ]; then
5155
if [[ ${version} != *"rc"* ]];then
5256
# version is not a Release Candidate
53-
cp -p ../../deploy/oas/v$version.html ../../deploy/oas/latest.html
57+
ln -sf ../../deploy/oas/v$version.html ../../deploy/oas/latest.html
5458
latestCopied=v$version
5559
fi
5660
fi
61+
62+
if [ ${minorVersion} != ${lastMinor} ] && [ ${minorVersion} != 2.0 ]; then
63+
ln -sf ../../deploy/oas/v$version.html ../../deploy/oas/v$minorVersion.html
64+
lastMinor=$minorVersion
65+
fi
5766
done
5867
echo Latest tag is $latest, copied $latestCopied to latest.html
5968

0 commit comments

Comments
 (0)