2020-01-12 01:07:19 +03:00
|
|
|
#!/bin/bash
|
|
|
|
# Called by Github Actions workflow
|
|
|
|
|
2020-11-30 03:01:18 +03:00
|
|
|
set -e;
|
2020-01-12 01:07:19 +03:00
|
|
|
|
2020-11-30 03:01:18 +03:00
|
|
|
os=$1;
|
|
|
|
case $os in
|
2021-03-08 19:30:14 +03:00
|
|
|
ubuntu-18.04)
|
2020-11-30 03:01:18 +03:00
|
|
|
output="abst_linux";
|
|
|
|
suffix="";
|
2021-08-26 02:52:43 +03:00
|
|
|
ext="sh";
|
2020-11-30 03:01:18 +03:00
|
|
|
;;
|
2020-01-12 01:07:19 +03:00
|
|
|
|
2020-11-30 03:01:18 +03:00
|
|
|
macos-latest)
|
|
|
|
output="abst_mac";
|
|
|
|
suffix="";
|
2021-08-26 02:52:43 +03:00
|
|
|
ext="sh";
|
2020-11-30 03:01:18 +03:00
|
|
|
;;
|
|
|
|
|
|
|
|
windows-latest)
|
|
|
|
output="abst_windows";
|
|
|
|
suffix=".exe";
|
2021-08-26 02:52:43 +03:00
|
|
|
ext="bat";
|
2020-11-30 03:01:18 +03:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Wat? os = $os";
|
|
|
|
exit 1;
|
|
|
|
esac
|
2020-02-09 00:25:48 +03:00
|
|
|
|
2020-01-12 01:07:19 +03:00
|
|
|
mkdir $output
|
|
|
|
|
2021-08-26 02:52:43 +03:00
|
|
|
cp release/play_abstreet.$ext release/ungap_the_map.$ext release/INSTRUCTIONS.txt $output
|
2020-11-30 03:01:18 +03:00
|
|
|
|
|
|
|
# Put most binaries in the root directory, but hide game to encourage people to
|
2021-08-26 02:52:43 +03:00
|
|
|
# use the launch scripts. They will capture output logs. But if somebody runs
|
|
|
|
# the game binary directly, it'll still work.
|
2020-01-12 01:07:19 +03:00
|
|
|
mkdir $output/game
|
2020-11-30 03:01:18 +03:00
|
|
|
cp target/release/game${suffix} $output/game
|
|
|
|
|
2022-01-23 13:27:32 +03:00
|
|
|
for name in cli fifteen_min osm_viewer parking_mapper santa ltn; do
|
2020-11-30 03:01:18 +03:00
|
|
|
cp target/release/${name}${suffix} $output;
|
|
|
|
done
|
|
|
|
|
2020-05-09 07:36:39 +03:00
|
|
|
mkdir $output/data
|
2020-05-04 21:43:19 +03:00
|
|
|
cp -Rv data/system $output/data/system
|
2020-10-09 00:26:35 +03:00
|
|
|
cp data/MANIFEST.json $output/data
|
2020-01-12 01:07:19 +03:00
|
|
|
|
2020-06-11 02:20:16 +03:00
|
|
|
# Windows doesn't have zip?!
|
|
|
|
if [[ "$output" != "abst_windows" ]]; then
|
|
|
|
# TODO Github will double-zip this, but if we just pass the directory, then the
|
|
|
|
# chmod +x bits get lost
|
|
|
|
zip -r $output $output
|
|
|
|
rm -rf release_data.zip $output
|
|
|
|
fi
|