Trim down the .zip build to only include Montlake -- that's it. [rebuild]

This commit is contained in:
Dustin Carlino 2021-04-20 11:41:02 -07:00
parent a2f08dcc52
commit 7004cd7af2
2 changed files with 10 additions and 3 deletions

View File

@ -62,7 +62,7 @@ jobs:
run: cargo build --release --bin importer --bin one_step_import --bin geojson_to_osmosis --bin pick_geofabrik --bin clip_osm --bin import_grid2demand run: cargo build --release --bin importer --bin one_step_import --bin geojson_to_osmosis --bin pick_geofabrik --bin clip_osm --bin import_grid2demand
- name: Download system data - name: Download system data
run: cargo run --release --bin updater run: cargo run --release --bin updater -- --minimal
- name: Package release - name: Package release
run: ./release/build.sh ${{ matrix.os }} run: ./release/build.sh ${{ matrix.os }}

View File

@ -39,12 +39,13 @@ async fn main() {
args.done(); args.done();
opt_into_all(); opt_into_all();
} else { } else {
let minimal = args.enabled("--minimal");
args.done(); args.done();
download_updates(version).await; download_updates(version, minimal).await;
} }
} }
async fn download_updates(version: String) { async fn download_updates(version: String, minimal: bool) {
let data_packs = DataPacks::load_or_create(); let data_packs = DataPacks::load_or_create();
let truth = Manifest::load().filter(data_packs); let truth = Manifest::load().filter(data_packs);
let local = generate_manifest(&truth); let local = generate_manifest(&truth);
@ -60,6 +61,12 @@ async fn download_updates(version: String) {
let mut failed = Vec::new(); let mut failed = Vec::new();
for (path, entry) in truth.entries { for (path, entry) in truth.entries {
if local.entries.get(&path).map(|x| &x.checksum) != Some(&entry.checksum) { if local.entries.get(&path).map(|x| &x.checksum) != Some(&entry.checksum) {
// For the Github Actions build, only include a few files to get started. The UI will
// download more data when the player tries to open another map.
if minimal && !path.contains("montlake") {
continue;
}
std::fs::create_dir_all(std::path::Path::new(&path).parent().unwrap()).unwrap(); std::fs::create_dir_all(std::path::Path::new(&path).parent().unwrap()).unwrap();
match download_file(&version, &path).await { match download_file(&version, &path).await {
Ok(bytes) => { Ok(bytes) => {