use Brian's new rust-only updater to finally make self-contained windows

builds! will update the finalize script later [rebuild]
This commit is contained in:
Dustin Carlino 2020-06-10 16:20:16 -07:00
parent 906566c05b
commit a9226e5ba9
3 changed files with 17 additions and 17 deletions

View File

@ -13,16 +13,14 @@ jobs:
run: cargo build --release --bin game
- name: Build importer
run: cargo build --release --bin importer
- name: Upload game
- name: Package release
run: ./release/build.sh abst_windows play_abstreet.bat target/release/game.exe target/release/importer.exe
shell: bash
- name: Upload release
uses: actions/upload-artifact@v2
with:
name: windows_exe
path: target/release/game.exe
- name: Upload importer
uses: actions/upload-artifact@v2
with:
name: windows_exe
path: target/release/importer.exe
name: abst_windows
path: abst_windows
build-macos:
runs-on: macos-latest
if: "contains(github.event.head_commit.message, '[rebuild]')"

View File

@ -21,7 +21,10 @@ cp $importer_binary $output/importer
mkdir $output/data
cp -Rv data/system $output/data/system
# 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
# 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

View File

@ -1,9 +1,8 @@
use std::collections::BTreeMap;
use std::error::Error;
use std::fs::{create_dir_all, remove_file, set_permissions, File, Permissions};
use std::io::Error as ioError;
use std::io::{copy, BufRead, BufReader, Read, Write};
use std::process::Command;
use walkdir::WalkDir;
const MD5_BUF_READ_SIZE: usize = 4096;
@ -56,7 +55,7 @@ async fn download() {
println!("{}, continuing", e);
}
};
// whether or not download failed, still try to clean up tmp file
// Whether or not download failed, still try to clean up tmp file
rm(TMP_DOWNLOAD_NAME);
}
}
@ -191,7 +190,7 @@ impl Manifest {
println!("- Wrote {}", path);
}
fn load(path: String) -> Result<Manifest, ioError> {
fn load(path: String) -> Result<Manifest, Box<dyn Error>> {
let mut kv = BTreeMap::new();
for line in BufReader::new(File::open(path)?).lines() {
let line = line?;
@ -377,7 +376,7 @@ fn rm(path: &str) {
}
}
async fn curl(entry: Entry) -> Result<(), Box<dyn std::error::Error>> {
async fn curl(entry: Entry) -> Result<(), Box<dyn Error>> {
let src = entry.dropbox_url.unwrap();
// the ?dl=0 param at the end of each URL takes you to an interactive page
// for viewing the folder in the browser. For some reason, curl and wget can