mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-27 14:04:56 +01:00
Merge #378
378: The stable book should build from branch r=korken89 a=AfoHT Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
This commit is contained in:
commit
04d415c3c6
1 changed files with 21 additions and 11 deletions
32
.github/workflows/build.yml
vendored
32
.github/workflows/build.yml
vendored
|
@ -594,27 +594,34 @@ jobs:
|
||||||
- name: Build books
|
- name: Build books
|
||||||
run: |
|
run: |
|
||||||
langs=( en ru )
|
langs=( en ru )
|
||||||
latest=0.5
|
devver=dev
|
||||||
vers=( 0.4.x )
|
# Query git for tagged releases, all releases start with "v"
|
||||||
|
# followed by MAJOR.MINOR.PATCH, see semver.org
|
||||||
|
# Then remove all pre-releases/tags with hyphens (-).
|
||||||
|
# The latest release is last, finally trim "v" and PATCH
|
||||||
|
stable=$(git tag | grep "^v" | grep -v "-" | tail -n 1 | cut -c2-4)
|
||||||
|
vers=( 0.5.x 0.4.x )
|
||||||
|
|
||||||
# Create directories
|
# Create directories
|
||||||
td=$(mktemp -d)
|
td=$(mktemp -d)
|
||||||
mkdir -p $td/$latest/book/
|
mkdir -p $td/$devver/book/
|
||||||
cp -r target/doc $td/$latest/api
|
cp -r target/doc $td/$devver/api
|
||||||
|
|
||||||
# sed fixes
|
# Redirect the main site to the stable release
|
||||||
sed 's|URL|rtic/index.html|g' redirect.html > $td/$latest/api/index.html
|
sed "s|URL|$stable|g" redirect.html > $td/index.html
|
||||||
sed 's|URL|0.5|g' redirect.html > $td/index.html
|
|
||||||
sed 's|URL|book/en|g' redirect.html > $td/$latest/index.html
|
# Create the redirects for dev-version
|
||||||
|
sed 's|URL|rtic/index.html|g' redirect.html > $td/$devver/api/index.html
|
||||||
|
sed 's|URL|book/en|g' redirect.html > $td/$devver/index.html
|
||||||
|
|
||||||
# Build books
|
# Build books
|
||||||
for lang in ${langs[@]}; do
|
for lang in ${langs[@]}; do
|
||||||
( cd book/$lang && mdbook build )
|
( cd book/$lang && mdbook build )
|
||||||
cp -r book/$lang/book $td/$latest/book/$lang
|
cp -r book/$lang/book $td/$devver/book/$lang
|
||||||
cp LICENSE-* $td/$latest/book/$lang/
|
cp LICENSE-* $td/$devver/book/$lang/
|
||||||
done
|
done
|
||||||
|
|
||||||
# Build older versions
|
# Build older versions, including stable
|
||||||
root=$(pwd)
|
root=$(pwd)
|
||||||
for ver in ${vers[@]}; do
|
for ver in ${vers[@]}; do
|
||||||
prefix=${ver%.*}
|
prefix=${ver%.*}
|
||||||
|
@ -639,6 +646,9 @@ jobs:
|
||||||
rm -rf $src
|
rm -rf $src
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Create alias for the stable release
|
||||||
|
ln -s $td/$stable $td/stable
|
||||||
|
|
||||||
# Forward CNAME file
|
# Forward CNAME file
|
||||||
cp CNAME $td/
|
cp CNAME $td/
|
||||||
mv $td/ bookstodeploy
|
mv $td/ bookstodeploy
|
||||||
|
|
Loading…
Reference in a new issue