-
Notifications
You must be signed in to change notification settings - Fork 77
/
create-release.sh
executable file
·30 lines (25 loc) · 1.13 KB
/
create-release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
set -e
cargo test
echo '--- Remove the old build artifacts ---'
rm -f docs/*.examples.js docs/*.wasm docs/*.png docs/*.ttf docs/*.atlas docs/*.ogg
for example in examples/*
do
example=$(basename $example .rs)
echo "---- Building example: $example ----"
cargo web build --release --example $example
echo "--- Copying build artifacts: $example ----"
cp target/wasm32-unknown-unknown/release/examples/$example.wasm docs/$example.wasm
cp target/wasm32-unknown-unknown/release/examples/$example.js docs/$example.example.js
done
echo "--- Copying assets to the web directory ---"
cp static/* docs/
read -p "New version string: " version
echo "--- Bumping version of the html_url_root ---"
sed -e "s/html_root_url = \".*\"/html_root_url = \"https:\/\/docs.rs\/quicksilver\/$version\/quicksilver\"/g" -i.bak src/lib.rs
echo "--- Bumping version in Cargo.toml ---"
sed -e "s/^version = \".*\"/version = \"$version\"/g" -i.bak Cargo.toml
echo "--- Bumping version in the changelog ---"
sed -e "s/## In-development/## In-development\n\n## $version/" -i.bak CHANGES.md
echo "--- Cleaning up the backups ---"
rm -f *.bak src/lib.rs.bak