mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* modernize github workflows this mainly fixes some inconsistencies in style, outdated or wrong comments and action version - replace Legit-Labs/action-download-artifact with actions/download-artifact - fix Swatinem/rust-cache arguments - fix benchmark transformations - expand feature soundness lints - wording and capitalization in comments * fix no_run on crate level doc * fix some more small issues
44 lines
1.0 KiB
Bash
Executable File
44 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Must be run from root of the repo:
|
|
# yew $ ./ci/build-examples.sh
|
|
|
|
output="$(pwd)/dist"
|
|
mkdir -p "$output"
|
|
|
|
failure=false
|
|
for path in examples/*; do
|
|
if [[ ! -d $path ]]; then
|
|
continue
|
|
fi
|
|
|
|
example=$(basename "$path")
|
|
|
|
# ssr does not need trunk
|
|
if [[ "$example" == "simple_ssr" || "$example" == "ssr_router" ]]; then
|
|
continue
|
|
fi
|
|
|
|
echo "::group::Building $example"
|
|
if ! (
|
|
set -e
|
|
# we are sure that $path exists
|
|
# shellcheck disable=SC2164
|
|
cd "$path"
|
|
dist_dir="$output/$example"
|
|
export RUSTFLAGS="--cfg nightly_yew"
|
|
|
|
trunk build --release --dist "$dist_dir" --public-url "$PUBLIC_URL_PREFIX/$example"
|
|
|
|
# check that there are no undefined symbols. Those generate an import .. from 'env',
|
|
# which isn't available in the browser.
|
|
{ cat "$dist_dir"/*.js | grep -q -e "from 'env'" ; } && exit 1 || true
|
|
) ; then
|
|
echo "::error ::$example failed to build"
|
|
failure=true
|
|
fi
|
|
echo "::endgroup::"
|
|
done
|
|
if [ "$failure" = true ] ; then
|
|
exit 1
|
|
fi
|