Skip to content

Commit

Permalink
workflow(cherrypick): switch to cargo-msfs
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigTag committed Jan 22, 2025
1 parent a177538 commit e0712b7
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[target.wasm32-wasi]
[target.wasm32-wasip1]
rustflags = [
"-Ctarget-feature=-crt-static,+bulk-memory",
"-Clink-self-contained=no",
Expand All @@ -21,4 +21,4 @@ rustflags = [
]

[build]
target = "wasm32-wasi"
target = "wasm32-wasip1"
42 changes: 21 additions & 21 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ jobs:
generate_release_notes: true

# Enable in future to automate publishing of NPM package
release-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: 'https://registry.npmjs.org'
cache: "npm"

- name: Install node modules
run: npm ci

- name: Build JS Interface
run: cd src/js && npm run build

- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: cd src/js && npm publish --tag next
# release-js:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4

# - uses: actions/setup-node@v4
# with:
# node-version: "18"
# registry-url: 'https://registry.npmjs.org'
# cache: "npm"

# - name: Install node modules
# run: npm ci

# - name: Build JS Interface
# run: cd src/js && npm run build

# - name: Publish to NPM
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: cd src/js && npm publish --tag next
25 changes: 9 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ lto = true
strip = true

[patch.crates-io]
rusqlite = { git = "https://github.com/navigraph/rusqlite", rev = "7921774" }
rusqlite = { git = "https://github.com/navigraph/rusqlite", rev = "f716d5c" }
3 changes: 2 additions & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[toolchain]
profile = "default"
channel = "1.79.0"
channel = "1.83"
targets = ["wasm32-wasip1"]
2 changes: 1 addition & 1 deletion scripts/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd %~dp0

call .\run_docker_cmd.bat ./scripts/build.sh
cargo-msfs build msfs2020 -i .. -o ..\out\msfs_navigation_data_interface.wasm

cd %~dp0

Expand Down
7 changes: 6 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash

# Required for compilation
cargo install --git https://github.com/navigraph/cargo-msfs

cargo-msfs install msfs2020

# Flags needed to get sqlite3 to work in the sim
export LIBSQLITE3_FLAGS="-DSQLITE_OMIT_SHARED_CACHE -D_LARGEFILE64_SOURCE"

cargo build --target wasm32-wasi --release && wasm-opt -O1 --signext-lowering --enable-bulk-memory -o /out/msfs_navigation_data_interface.wasm /external/target/wasm32-wasi/release/msfs_navigation_data_interface.wasm
cargo-msfs build msfs2020 -i .. -o ../out/msfs_navigation_data_interface.wasm
4 changes: 2 additions & 2 deletions src/database/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rusqlite = { version = "0.30.0", features = ["bundled"] }
serde_rusqlite = "0.34.0"
rusqlite = { version = "0.32.0", features = ["bundled"] }
serde_rusqlite = "0.36.0"
serde = { version = "1.0.190", features = ["derive"] }
serde_json = "1.0.108"
serde_with = "3.4.0"
Expand Down
2 changes: 1 addition & 1 deletion src/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "msfs-navigation-data-interface"
version = "1.1.0"
version = "1.1.1"
edition = "2021"

[lib]
Expand Down

0 comments on commit e0712b7

Please sign in to comment.