abstreet/release/deploy_web.sh
Dustin Carlino c481567ebb Cut over from Dropbox to S3. #195, #326
Uploading files individually to Dropbox is flaky, and the unique URL per
file complicates data/MANIFEST.

While we're at it, start carving aside a directory structure for keeping
data for the last few releases.

[rebuild] to make sure github actions can download everything
2020-11-02 17:36:02 -08:00

25 lines
771 B
Bash
Executable File

#!/bin/bash
VERSION=dev
set -e
cd game
wasm-pack build --release --target web -- --no-default-features --features wasm,wasm_s3
cd pkg
# Temporarily remove the symlink to the data directory; it's uploaded separately by the updater tool
rm -f system
aws s3 sync . s3://abstreet/$VERSION
# Undo that symlink hiding
git checkout system
# Set the content type for .wasm files, to speed up how browsers load them
aws s3 cp \
s3://abstreet/$VERSION \
s3://abstreet/$VERSION \
--exclude '*' \
--include '*.wasm' \
--no-guess-mime-type \
--content-type="application/wasm" \
--metadata-directive="REPLACE" \
--recursive
echo "Have the appropriate amount of fun: http://abstreet.s3-website.us-east-2.amazonaws.com/$VERSION"