-
Notifications
You must be signed in to change notification settings - Fork 1
Add CI workflow to build CrossBasic on Linux and Windows #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
simulanics
merged 8 commits into
main
from
codex/create-github-actions-workflow-for-crossbasic-builds
Dec 21, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3fc122c
Add CI workflow to build CrossBasic on Linux and Windows
simulanics 8855504
Add missing dependencies to CI workflow
simulanics 1a71de8
Improve Windows CI dependencies and flags
simulanics 3aea8e8
Clarify Windows libs requirements
simulanics 2211462
Fix Windows boost alias in workflow
simulanics 5554151
Add macOS and Linux arm64 builds to workflow
simulanics 6fbbddb
Update macOS runners and libffi setup
simulanics 6807687
Limit CI matrix and add Windows static libs
simulanics File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| name: Build CrossBasic | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, master ] | ||
| tags: [ 'v*' ] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build (${{ matrix.name }}) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - name: linux-x64 | ||
| os: ubuntu-latest | ||
| - name: windows-x64 | ||
| os: windows-latest | ||
|
|
||
| env: | ||
| RELEASE_DIR: release-64 | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Rust toolchain (Linux) | ||
| if: startsWith(matrix.os, 'ubuntu') | ||
| uses: actions-rs/toolchain@v1 | ||
| with: | ||
| profile: minimal | ||
| toolchain: stable | ||
| override: true | ||
|
|
||
| - name: Set up Rust toolchain (Windows GNU) | ||
| if: matrix.os == 'windows-latest' | ||
| uses: actions-rs/toolchain@v1 | ||
| with: | ||
| profile: minimal | ||
| toolchain: stable | ||
| target: x86_64-pc-windows-gnu | ||
| override: true | ||
|
|
||
| - name: Install Linux dependencies | ||
| if: startsWith(matrix.os, 'ubuntu') | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y \ | ||
| g++ \ | ||
| libffi-dev \ | ||
| libgmp-dev \ | ||
| libboost-all-dev \ | ||
| libcurl4-openssl-dev \ | ||
| libsqlite3-dev \ | ||
| libglew-dev | ||
|
|
||
| - name: Install Windows build toolchain and dependencies | ||
| if: matrix.os == 'windows-latest' | ||
| shell: pwsh | ||
| run: | | ||
| choco install nuget.commandline -y | ||
| choco install msys2 -y | ||
|
|
||
| C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy" | ||
| C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-boost mingw-w64-x86_64-libffi mingw-w64-x86_64-gmp mingw-w64-x86_64-curl mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-glew mingw-w64-x86_64-glfw mingw-w64-x86_64-cppwinrt" | ||
|
|
||
| nuget install Microsoft.Web.WebView2 -Version 1.0.2210.55 -OutputDirectory $pwd\deps | ||
|
|
||
| "C:\\msys64\\mingw64\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
| "CPLUS_INCLUDE_PATH=$pwd\deps\Microsoft.Web.WebView2.1.0.2210.55\build\native\include" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
|
|
||
| C:\msys64\usr\bin\bash -lc 'for lib in system thread; do src=$(ls /mingw64/lib/libboost_${lib}*.a | head -n1); cp "$src" /mingw64/lib/libboost_${lib}-mgw14-mt-s-x64-1_87.a; done' | ||
|
|
||
| $zipPath = "$pwd\deps\mingw-libs.zip" | ||
| Invoke-WebRequest -Uri "https://www.simulanics.com/libs.zip" -OutFile $zipPath | ||
| Expand-Archive -LiteralPath $zipPath -DestinationPath "$pwd\deps\mingw-libs" | ||
|
|
||
| "LIBRARY_PATH=$pwd\deps\mingw-libs;$env:LIBRARY_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
| "LIB=$pwd\deps\mingw-libs;$env:LIB" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
|
|
||
| - name: Set Windows build flags | ||
| if: matrix.os == 'windows-latest' | ||
| shell: cmd | ||
| run: | | ||
| echo CXXFLAGS=-std=c++20 -fcoroutines >> %GITHUB_ENV% | ||
| echo CFLAGS=-std=c11 >> %GITHUB_ENV% | ||
|
|
||
| - name: Make scripts executable (Linux) | ||
| if: matrix.os == 'ubuntu-latest' | ||
| run: chmod +x build_crossbasic.sh build_xcompile.sh build_appserver.sh build_plugins.sh | ||
|
|
||
| - name: Build on Linux | ||
| if: matrix.os == 'ubuntu-latest' | ||
| run: | | ||
| ./build_crossbasic.sh | ||
| ./build_xcompile.sh | ||
| ./build_appserver.sh | ||
| ./build_plugins.sh | ||
|
|
||
| - name: Build on Windows | ||
| if: matrix.os == 'windows-latest' | ||
| run: | | ||
| call build_all_windows.bat | ||
| shell: cmd | ||
|
|
||
| - name: Copy Windows runtime libraries | ||
| if: matrix.os == 'windows-latest' | ||
| shell: cmd | ||
| run: | | ||
| if not exist %RELEASE_DIR%\libs mkdir %RELEASE_DIR%\libs | ||
| xcopy libs %RELEASE_DIR%\libs /E /I /Y | ||
|
|
||
| - name: Upload artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: crossbasic-${{ matrix.name }} | ||
| path: ${{ env.RELEASE_DIR }} | ||
| if-no-files-found: error | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,7 @@ | ||
| Windows-specific dynamic link library dependencies. | ||
| Windows-specific dynamic link library dependencies. | ||
|
|
||
| The Windows workflows copy everything in this folder into the final `release-64/libs` | ||
| output. If required runtime DLLs are missing here, Windows builds will succeed but the | ||
| published artifact will launch with missing-library errors. Make sure the proprietary | ||
| or prebuilt DLLs the application depends on (e.g., bundled plugin runtimes) are added | ||
| before cutting a release. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Windows matrix job calls
build_all_windows.bat, which invokesbuild_appserver.batlinking against Boost static libs (libboost_system-mgw14-mt-s-x64-1_87.a,libboost_thread-mgw14-mt-s-x64-1_87.a). The workflow only installs MinGW and a Rust toolchain and the repository contains no Boost binaries, so onwindows-latestthe link step will fail with missing Boost libraries and the Windows build will never succeed.Useful? React with 👍 / 👎.