diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c258999..94318c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,9 @@ jobs: - name: Install Rust uses: hecrj/setup-rust-action@v1 + with: + rust-version: nightly + components: rust-src - name: Install target run: rustup target add wasm32-unknown-unknown @@ -75,7 +78,7 @@ jobs: - name: Build Core run: | set -e - npm run build:core:production + npm run build:core:deploy - name: Set up tslint matcher run: echo "::add-matcher::.github/workflows/tslint.json" diff --git a/buildCore.js b/buildCore.js index 7d583fd..35ffebd 100644 --- a/buildCore.js +++ b/buildCore.js @@ -2,14 +2,19 @@ import { execSync } from "child_process"; import fs from "fs"; let buildFlags = ""; +let toolchain = ""; let targetFolder = "debug"; if (process.argv.some((v) => v === "--production")) { buildFlags = "--release"; targetFolder = "release"; } +if (process.argv.some((v) => v === "--nightly")) { + toolchain = "+nightly"; + buildFlags += " -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort"; +} execSync( - "cargo run", + `cargo ${toolchain} run`, { cwd: "livesplit-core/capi/bind_gen", stdio: "inherit", @@ -17,7 +22,7 @@ execSync( ); execSync( - `cargo rustc -p livesplit-core-capi --crate-type cdylib --features wasm-web --target wasm32-unknown-unknown ${buildFlags}`, + `cargo ${toolchain} rustc -p livesplit-core-capi --crate-type cdylib --features wasm-web --target wasm32-unknown-unknown ${buildFlags}`, { cwd: "livesplit-core", stdio: "inherit", diff --git a/package.json b/package.json index dc37777..08335e5 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "build": "webpack", "build:core": "node buildCore.js", "build:core:production": "node buildCore.js --production", + "build:core:deploy": "node buildCore.js --production --nightly", "lint": "tslint --project tsconfig.json", "publish": "webpack --mode production", "serve": "webpack serve",