Skip to content

Commit a323df0

Browse files
authored
Merge pull request #14 from Navigraph/v1-workflow-fixes
2 parents 7ff9ee3 + a14b494 commit a323df0

20 files changed

+129
-117
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
target
2+
out
3+
node_modules
4+
test_work

.github/workflows/pr.yml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- synchronize
77
- ready_for_review
88

9-
name: Label, Build & Lint PR
9+
name: PR Checks
1010

1111
jobs:
1212
autolabel:
@@ -50,7 +50,7 @@ jobs:
5050

5151
build-test:
5252
name: Build & test 🛠️
53-
runs-on: windows-2022
53+
runs-on: ubuntu-latest
5454
if: ${{ !github.event.pull_request.draft && !contains(github.event.pull_request.labels.*.name , 'release') }}
5555
steps:
5656
- name: Checkout
@@ -63,28 +63,16 @@ jobs:
6363
echo NAVIGATION_DATA_SIGNED_URL=${{ secrets.NAVIGATION_DATA_SIGNED_URL }} >> .env
6464
echo NAVIGATION_DATA_SIGNED_URL_V2=${{ secrets.NAVIGATION_DATA_SIGNED_URL_V2 }} >> .env
6565
66-
- name: Install LLVM and Clang
67-
uses: KyleMayes/[email protected]
68-
with:
69-
version: "17.0.6"
70-
71-
- name: Cache cargo-msfs
72-
uses: actions/cache@v4
73-
with:
74-
path: ~\.cargo\bin
75-
key: ${{ runner.os }}-cargo-msfs
76-
77-
- name: Setup
78-
run: npm run setup
79-
80-
- name: Build WASM module
81-
run: npm run build:wasm-workflow
66+
- name: Build WASM
67+
run: ./scripts/workflow.sh
8268

83-
- name: Test
84-
run: npm run test-workflow
69+
# - name: Test
70+
# run: npm run test-workflow
8571

8672
- name: Upload WASM module to GitHub
8773
uses: actions/upload-artifact@v4
8874
with:
89-
name: msfs_navigation_data_interface.wasm
90-
path: ./out/msfs_navigation_data_interface.wasm
75+
name: msfs_navigation_data_interface
76+
path: |
77+
./2020.zip
78+
./2024.zip

.github/workflows/pre-release.yml

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,41 @@ run-name: Create pre-release for `${{ github.ref_name }}`
1010

1111
jobs:
1212
release-wasm:
13-
runs-on: windows-2022
13+
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
1616

17-
- name: Install LLVM and Clang
18-
uses: KyleMayes/[email protected]
19-
with:
20-
version: "17.0.6"
21-
22-
- name: Cache cargo-msfs
23-
uses: actions/cache@v4
24-
with:
25-
path: ~\.cargo\bin
26-
key: ${{ runner.os }}-cargo-msfs
27-
28-
- name: Setup
29-
run: npm run setup
30-
31-
- name: Build WASM module
32-
run: npm run build:wasm-workflow
17+
- name: Build WASM
18+
run: ./scripts/workflow.sh
3319

3420
- name: Pre-Release
3521
uses: softprops/action-gh-release@v1
3622
with:
37-
files: ./out/msfs_navigation_data_interface.wasm
23+
files: |
24+
./2020.zip
25+
./2024.zip
3826
prerelease: true
3927
generate_release_notes: true
4028

4129
# Enable in future to automate publishing of NPM package
42-
release-js:
43-
runs-on: ubuntu-latest
44-
steps:
45-
- uses: actions/checkout@v4
46-
47-
- uses: actions/setup-node@v4
48-
with:
49-
node-version: "18"
50-
registry-url: 'https://registry.npmjs.org'
51-
cache: "npm"
52-
53-
- name: Install node modules
54-
run: npm ci
55-
56-
- name: Build JS Interface
57-
run: cd src/js && npm run build
58-
59-
- name: Publish to NPM
60-
env:
61-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62-
run: cd src/js && npm publish --tag next
30+
# release-js:
31+
# runs-on: ubuntu-latest
32+
# steps:
33+
# - uses: actions/checkout@v4
34+
35+
# - uses: actions/setup-node@v4
36+
# with:
37+
# node-version: "18"
38+
# registry-url: 'https://registry.npmjs.org'
39+
# cache: "npm"
40+
41+
# - name: Install node modules
42+
# run: npm ci
43+
44+
# - name: Build JS Interface
45+
# run: cd src/js && npm run build
46+
47+
# - name: Publish to NPM
48+
# env:
49+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50+
# run: cd src/js && npm publish --tag next

.github/workflows/release.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,15 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717

18-
- name: Install LLVM and Clang
19-
uses: KyleMayes/[email protected]
20-
with:
21-
version: "17.0.6"
22-
23-
- name: Cache cargo-msfs
24-
uses: actions/cache@v4
25-
with:
26-
path: ~\.cargo\bin
27-
key: ${{ runner.os }}-cargo-msfs
28-
29-
- name: Setup
30-
run: npm run setup
31-
32-
- name: Build WASM module
33-
run: npm run build:wasm-workflow
18+
- name: Build WASM
19+
run: ./scripts/workflow.sh
3420

3521
- name: Release
3622
uses: softprops/action-gh-release@v1
3723
with:
38-
files: ./out/msfs_navigation_data_interface.wasm
24+
files: |
25+
./2020.zip
26+
./2024.zip
3927
generate_release_notes: true
4028

4129
# Enable in future to automate publishing of NPM package

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ tsconfig.tsbuildinfo
77
examples/aircraft/PackageSources/html_ui/Pages/VCockpit/Instruments/Navigraph/NavigationDataInterfaceSample
88
examples/aircraft/PackageSources/SimObjects/Airplanes/Navigraph_Navigation_Data_Interface_Aircraft/panel/msfs_navigation_data_interface.wasm
99
out
10+
out20
11+
out24
1012

1113
# Rust
1214
# will have compiled files and executables

Cargo.lock

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM ghcr.io/navigraph/cargo-msfs-bin:latest AS base
2+
3+
RUN apt install git -y
4+
5+
RUN cargo-msfs install msfs2020
6+
RUN cargo-msfs install msfs2024
7+
8+
FROM base AS builder
9+
10+
WORKDIR /external
11+
12+
COPY rust-toolchain.toml ./
13+
RUN rustup show
14+
15+
COPY . .

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
"format": "prettier --write .",
88
"lint:js": "eslint \"src/js/**/*.ts\"",
99
"setup": ".\\scripts\\setup.bat",
10-
"build:wasm": ".\\scripts\\build.bat",
11-
"build:wasm-workflow": ".\\scripts\\build_workflow.bat",
10+
"build:wasm": ".\\scripts\\build.bat both",
11+
"build:wasm:2020": ".\\scripts\\build.bat 2020",
12+
"build:wasm:2024": ".\\scripts\\build.bat 2024",
1213
"build:js": "cd .\\src\\js && npm run build",
1314
"build:gauge": "cd .\\examples\\gauge && npm run build",
1415
"dev:gauge": "cd .\\examples\\gauge && npm run dev",

scripts/build.bat

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
cd %~dp0
44

5-
mkdir ..\out
5+
CALL .\run_docker_cmd.bat ./scripts/build.sh %*
66

7-
cargo-msfs build msfs2020 -i .. -o ..\out\msfs_navigation_data_interface.wasm
8-
9-
copy ..\out\msfs_navigation_data_interface.wasm ..\examples\aircraft\PackageSources\SimObjects\Airplanes\Navigraph_Navigation_Data_Interface_Aircraft\panel
7+
copy ..\out20\msfs_navigation_data_interface.wasm ..\examples\aircraft\PackageSources\SimObjects\Airplanes\Navigraph_Navigation_Data_Interface_Aircraft\panel

scripts/build.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
if ! [ -a out20 ]; then
4+
mkdir out20
5+
fi
6+
7+
if ! [ -a out24 ]; then
8+
mkdir out24
9+
fi
10+
11+
if [ $1 = "2020" ] || [ $1 = "both" ]; then
12+
echo "Building MSFS 2020"
13+
cargo-msfs build msfs2020 -i . -o out20/msfs_navigation_data_interface.wasm
14+
fi
15+
16+
if [ $1 = "2024" ] || [ $1 = "both" ]; then
17+
echo "Building MSFS 2024"
18+
cargo-msfs build msfs2024 -i . -o out24/msfs_navigation_data_interface.wasm
19+
fi

0 commit comments

Comments
 (0)