Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

respec workflow: create symlinks for spec minor versions #4191

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions scripts/md2html/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,29 @@ cp -p ../../node_modules/respec/builds/respec-w3c.* ../../deploy/js/

latest=`git describe --abbrev=0 --tags`
latestCopied=none
for filename in ../../versions/[23456789].*.md ; do
lastMinor="-"
for filename in $(ls -1 ../../versions/[23456789].*.md | sort -r) ; do
version=$(basename "$filename" .md)
minorVersion=${version:0:3}
tempfile=../../deploy/oas/v$version-tmp.html
echo -e "\n=== v$version ==="

node md2html.js --maintainers ./history/MAINTAINERS_v$version.md ${filename} > $tempfile
npx respec --use-local --src $tempfile --out ../../deploy/oas/v$version.html
rm $tempfile

if [ $version = $latest ]; then
if [[ ${version} != *"rc"* ]];then
# version is not a Release Candidate
cp -p ../../deploy/oas/v$version.html ../../deploy/oas/latest.html
ln -sf ../../deploy/oas/v$version.html ../../deploy/oas/latest.html
latestCopied=v$version
fi
fi

if [ ${minorVersion} != ${lastMinor} ] && [ ${minorVersion} != 2.0 ]; then
ln -sf ../../deploy/oas/v$version.html ../../deploy/oas/v$minorVersion.html
lastMinor=$minorVersion
fi
done
echo Latest tag is $latest, copied $latestCopied to latest.html

Expand Down