Build for Windows using MSVC, add Windows arm64 build #64
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
| name: Build and test | |
| on: [push, pull_request] | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| SCONS_CACHE: ${{ github.workspace }}/.scons-cache | |
| jobs: | |
| build_macos: | |
| name: ${{ matrix.platform }} (simulator=${{ matrix.simulator }}, ${{ matrix.arch }}, ${{ matrix.target }}) | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [template_debug, template_release] | |
| arch: [universal] | |
| platform: [macos, ios] | |
| simulator: [true, false] | |
| exclude: | |
| - platform: macos | |
| simulator: true | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - name: Setup godot-cpp | |
| uses: ./lib/godot-cpp/.github/actions/setup-godot-cpp | |
| with: | |
| platform: ${{ matrix.platform }} | |
| - name: Cache SCons files and compiled files | |
| uses: actions/cache@v4 | |
| with: | |
| path: .scons-cache/ | |
| key: ${{ matrix.platform }}-simulator=${{ matrix.simulator }}-${{ matrix.arch }}-${{ matrix.target }}-${{ hashfiles('.gitmodules', 'SConstruct', 'src/**') }} | |
| restore-keys: | | |
| ${{ matrix.platform }}-simulator=${{ matrix.simulator }}-${{ matrix.arch }}-${{ matrix.target }}- | |
| - name: Build artifact | |
| run: | | |
| scons platform=${{ matrix.platform }} ios_simulator=${{ matrix.simulator }} arch=${{ matrix.arch }} target=${{ matrix.target }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }} | |
| path: | | |
| addons/objc-gdextension/build/libobjcgdextension.* | |
| build_linux: | |
| name: ${{ matrix.platform }} (${{ matrix.arch }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [x86_64, x86_32] | |
| platform: [linux, android] | |
| include: | |
| - platform: linux | |
| arch: x86_32 | |
| packages: [g++-multilib] | |
| - platform: android | |
| arch: arm64 | |
| - platform: android | |
| arch: arm32 | |
| scons-args: android_api_level=19 | |
| - platform: android | |
| arch: x86_32 | |
| scons-args: android_api_level=19 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - name: Setup godot-cpp | |
| uses: ./lib/godot-cpp/.github/actions/setup-godot-cpp | |
| with: | |
| platform: ${{ matrix.platform }} | |
| - name: Setup dependencies | |
| if: ${{ join(matrix.packages, ' ') != '' }} | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install ${{ join(matrix.packages, ' ') }} | |
| - name: Generate bindings | |
| run: | | |
| make -C lib/gdextension-lite generate-bindings | |
| - name: Build artifact | |
| run: | | |
| scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} target=template_release build_library=false ${{ join(matrix.scons-args, ' ') }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform }}-${{ matrix.arch }} | |
| path: | | |
| addons/objc-gdextension/build/libobjcgdextension.* | |
| build_windows: | |
| name: ${{ matrix.platform }} (${{ matrix.arch }}) | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [x86_64, x86_32, arm64] | |
| platform: [windows] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - name: Setup godot-cpp | |
| uses: ./lib/godot-cpp/.github/actions/setup-godot-cpp | |
| with: | |
| platform: ${{ matrix.platform }} | |
| windows-compiler: msvc | |
| - name: Generate bindings | |
| run: | | |
| make -C lib/gdextension-lite generate-bindings | |
| - name: Build artifact | |
| run: | | |
| scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} target=template_release build_library=false ${{ join(matrix.scons-args, ' ') }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform }}-${{ matrix.arch }} | |
| path: | | |
| addons/objc-gdextension/build/libobjcgdextension.* | |
| test_distribution: | |
| name: Test ${{ matrix.name }} | |
| needs: [build_macos] | |
| runs-on: ${{ matrix.runner-os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: macOS | |
| runner-os: macos-latest | |
| godot-release: 4.5.1-stable/Godot_v4.5.1-stable_macos.universal.zip | |
| godot-bin: ./Godot.app/Contents/MacOS/Godot | |
| env: | |
| GODOT_BIN: ${{ matrix.godot-bin }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Download artifacts | |
| id: download | |
| uses: actions/download-artifact@v5 | |
| with: | |
| path: artifacts | |
| - name: Copy artifacts to build folder | |
| run: cp -r '${{ steps.download.outputs.download-path }}'/**/libobjcgdextension* addons/objc-gdextension/build | |
| - name: Download Godot | |
| run: | | |
| curl --location https://github.com/godotengine/godot/releases/download/${{ matrix.godot-release }} --output godot.zip | |
| unzip godot.zip | |
| - name: Run tests | |
| run: | | |
| make test | |
| build_distribution_zip: | |
| name: Build distribution zip | |
| needs: [build_macos, build_linux] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Download artifacts | |
| id: download | |
| uses: actions/download-artifact@v5 | |
| with: | |
| path: artifacts | |
| - name: Copy artifacts to build folder | |
| run: cp -r ${{ steps.download.outputs.download-path }}/**/libobjcgdextension* addons/objc-gdextension/build | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: objc-gdextension | |
| path: | | |
| LICENSE | |
| addons/objc-gdextension/LICENSE | |
| addons/objc-gdextension/*.gdextension | |
| addons/objc-gdextension/build/libobjcgdextension* | |