try again to bundle importer in release for oneshot. disable gdal.

[rebuild]
This commit is contained in:
Dustin Carlino 2020-05-17 09:25:44 -07:00
parent c04ce5a5c0
commit e082082c32
7 changed files with 29 additions and 10 deletions

View File

@ -9,10 +9,12 @@ jobs:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.43.0
- name: Run build
- name: Build game
run: cargo build --release --bin game
- name: Build importer
run: cargo build --release --bin importer
- name: Package release
run: ./release/build.sh abst_windows play_abstreet.bat target/release/game.exe
run: ./release/build.sh abst_windows play_abstreet.bat target/release/game.exe target/release/importer.exe
- name: Upload binary
uses: actions/upload-artifact@v1
with:
@ -26,10 +28,12 @@ jobs:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.43.0
- name: Run build
- name: Build game
run: cargo build --release --bin game
- name: Build importer
run: cargo build --release --bin importer
- name: Package release
run: ./release/build.sh abst_mac play_abstreet.sh target/release/game
run: ./release/build.sh abst_mac play_abstreet.sh target/release/game target/release/importer
- name: Upload release
uses: actions/upload-artifact@v1
with:
@ -43,10 +47,12 @@ jobs:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.43.0
- name: Run build
- name: Build game
run: cargo build --release --bin game
- name: Build importer
run: cargo build --release --bin importer
- name: Package release
run: ./release/build.sh abst_linux play_abstreet.sh target/release/game
run: ./release/build.sh abst_linux play_abstreet.sh target/release/game target/release/importer
- name: Upload release
uses: actions/upload-artifact@v1
with:

View File

@ -1,5 +1,5 @@
#!/bin/bash
cd importer;
RUST_BACKTRACE=1 cargo run --release -- $@;
RUST_BACKTRACE=1 cargo run --release --features scenarios -- $@;
cd ..;

View File

@ -4,12 +4,16 @@ version = "0.1.0"
authors = ["Dustin Carlino <dabreegster@gmail.com>"]
edition = "2018"
[features]
default = []
scenarios = ["gdal"]
[dependencies]
abstutil = { path = "../abstutil" }
convert_osm = { path = "../convert_osm" }
csv = "1.0.1"
geom = { path = "../geom" }
gdal = "0.6.0"
gdal = { version = "0.6.0", optional = true }
kml = { path = "../kml" }
map_model = { path = "../map_model" }
serde = "1.0.98"

View File

@ -1,5 +1,6 @@
mod austin;
mod seattle;
#[cfg(feature = "scenarios")]
mod soundcast;
mod utils;
@ -97,6 +98,7 @@ fn main() {
}
}
#[cfg(feature = "scenarios")]
if job.scenario {
assert_eq!(job.city, "seattle");
seattle::ensure_popdat_exists();
@ -106,6 +108,7 @@ fn main() {
soundcast::make_weekday_scenario(&map, &mut timer).save();
}
#[cfg(feature = "scenarios")]
if job.scenario_everyone {
assert_eq!(job.city, "seattle");
seattle::ensure_popdat_exists();

View File

@ -70,6 +70,7 @@ pub fn osm_to_raw(name: &str) {
}
// Download and pre-process data needed to generate Seattle scenarios.
#[cfg(feature = "scenarios")]
pub fn ensure_popdat_exists() {
if abstutil::file_exists(abstutil::path_popdat()) {
println!("- {} exists, not regenerating it", abstutil::path_popdat());

View File

@ -5,7 +5,8 @@ set -e
output=$1;
runner=$2;
binary=$3;
game_binary=$3;
importer_binary=$4;
cargo run --bin updater
@ -14,7 +15,9 @@ mkdir $output
cp docs/INSTRUCTIONS.md $output
cp release/$runner $output
mkdir $output/game
cp $binary $output/game
cp $game_binary $output/game
mkdir $output/importer
cp $importer_binary $output/importer
mkdir $output/data
cp -Rv data/system $output/data/system

View File

@ -27,6 +27,8 @@ cd game
rm -f game
unzip ~/Downloads/game_exe.zip
rm -f ~/Downloads/game_exe.zip
rm -f ../importer/importer
mv importer.exe ../importer
cd ../..
zip -r abstreet_linux_$VERSION abstreet_linux_$VERSION