diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6c1b1b5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,83 @@ +name: Build MSVC MSFS WASM Project + +on: + push: + branches: [ "*" ] + pull_request: + branches: [ "*" ] + +env: + # Path to the solution file relative to the root of the project. + SOLUTION_FILE_PATH: ./src/Sources/Code/ + BUILD_CONFIGURATION: Release + MSFS_SDK: C:\MSFS SDK\ + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Download MSFS SDK + shell: powershell + run: | + $url = "${{ secrets.MSFS_SDK_MSI_URL }}" + Invoke-WebRequest -UserAgent curl/8.7.1 -Uri $url -MaximumRedirection 5 -OutFile "MSFS_SDK_Core_Installer_0.24.5.msi" + Start-Process msiexec.exe -ArgumentList "/i MSFS_SDK_Core_Installer_0.24.5.msi ADDLOCAL=ALL /quiet /qn /norestart" -Wait + dir "C:\MSFS SDK" + + - name: Set SDK Environment Variable + run: echo "MSFS_SDK=C:\MSFS SDK\" >> $GITHUB_ENV + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v3 + with: + msbuild-architecture: MSFS + + - name: Build WASM Project + working-directory: ${{env.SOLUTION_FILE_PATH}} + run: | + msbuild MobiFlightWasmModule.sln /p:Configuration=Release /p:Platform=MSFS + shell: cmd + + - name: Download MSFSLayoutGenerator + shell: powershell + run: | + $url = "https://github.com/HughesMDflyer4/MSFSLayoutGenerator/releases/download/v1.1.2/MSFSLayoutGenerator.exe" + Invoke-WebRequest -UserAgent curl/8.7.1 -Uri $url -MaximumRedirection 5 -OutFile "MSFSLayoutGenerator.exe" + Start-Process MSFSLayoutGenerator.exe -ArgumentList " ./src/PackagesExport/mobiflight-event-module/layout.json" -Wait + git diff --exit-code + $LASTEXITCODE = 0 + + - name: Upload WASM Artifacts + uses: actions/upload-artifact@v4 + with: + name: wasm-build-artifacts + path: | + ./src/PackagesExport/ + + mf_wasm_release: + needs: build + runs-on: ubuntu-latest + if: github.ref_type == 'tag' + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + pattern: wasm-build-* + merge-multiple: true + - name: Archive production artifacts + run: zip -r mobiflight-event-module.zip mobiflight-event-module + - name: Upload to Release + continue-on-error: true + uses: meeDamian/github-release@2.0 + with: + tag: ${{ github.ref_name }} + draft: true + allow_override: true + gzip: false + token: ${{ secrets.GITHUB_TOKEN }} + files: > + mobiflight-event-module.zip \ No newline at end of file diff --git a/src/PackagesExport/mobiflight-event-module/ContentInfo/mobiflight-event-module/Thumbnail.jpg b/src/PackagesExport/mobiflight-event-module/ContentInfo/mobiflight-event-module/Thumbnail.jpg new file mode 100644 index 0000000..131711a Binary files /dev/null and b/src/PackagesExport/mobiflight-event-module/ContentInfo/mobiflight-event-module/Thumbnail.jpg differ diff --git a/src/PackagesExport/mobiflight-event-module/layout.json b/src/PackagesExport/mobiflight-event-module/layout.json new file mode 100644 index 0000000..c2122e8 --- /dev/null +++ b/src/PackagesExport/mobiflight-event-module/layout.json @@ -0,0 +1,19 @@ +{ + "content": [ + { + "path": "ContentInfo/mobiflight-event-module/Thumbnail.jpg", + "size": 50630, + "date": 132959331316311030 + }, + { + "path": "modules/events.txt", + "size": 361907, + "date": 132959331316360881 + }, + { + "path": "modules/MobiFlightWasmModule.wasm", + "size": 1817773, + "date": 134226348194752705 + } + ] +} \ No newline at end of file diff --git a/src/PackagesExport/mobiflight-event-module/manifest.json b/src/PackagesExport/mobiflight-event-module/manifest.json new file mode 100644 index 0000000..2ef8c20 --- /dev/null +++ b/src/PackagesExport/mobiflight-event-module/manifest.json @@ -0,0 +1,15 @@ +{ + "dependencies": [], + "content_type": "MISC", + "title": "Event Module", + "manufacturer": "", + "creator": "MobiFlight", + "package_version": "1.0.1", + "minimum_game_version": "1.39.12", + "release_notes": { + "neutral": { + "LastUpdate": "VERSION 1.0.1 RELEASED JANUARY 1, 0\\n", + "OlderHistory": "" + } + } +} \ No newline at end of file diff --git a/src/Sources/Code/StandaloneModule.vcxproj b/src/Sources/Code/StandaloneModule.vcxproj index 04a0d88..5bc1581 100644 --- a/src/Sources/Code/StandaloneModule.vcxproj +++ b/src/Sources/Code/StandaloneModule.vcxproj @@ -80,7 +80,9 @@ mkdir "$(SolutionDir)..\..\PackageSources\modules" copy /Y "$(TargetPath)" "$(SolutionDir)..\..\PackageSources\modules" -copy /Y "$(TargetDir)events*.txt" "$(SolutionDir)..\..\PackageSources\modules" +copy /Y "$(TargetDir)events*.txt" "$(SolutionDir)..\..\PackageSources\modules" +copy /Y "$(TargetPath)" "$(SolutionDir)..\..\PackagesExport\mobiflight-event-module\modules" +copy /Y "$(TargetDir)events*.txt" "$(SolutionDir)..\..\PackagesExport\mobiflight-event-module\modules" @@ -109,7 +111,9 @@ copy /Y "$(TargetDir)events*.txt" "$(SolutionDir)..\..\PackageSources\modules" mkdir "$(SolutionDir)..\..\PackageSources\modules" copy /Y "$(TargetPath)" "$(SolutionDir)..\..\PackageSources\modules" -copy /Y "$(TargetDir)events.txt" "$(SolutionDir)..\..\PackageSources\modules" +copy /Y "$(TargetDir)events.txt" "$(SolutionDir)..\..\PackageSources\modules" +copy /Y "$(TargetPath)" "$(SolutionDir)..\..\PackagesExport\mobiflight-event-module\modules" +copy /Y "$(TargetDir)events.txt" "$(SolutionDir)..\..\PackagesExport\mobiflight-event-module\modules"