Skip to content

Commit

Permalink
GHA: Add action to build .NET assemblies
Browse files Browse the repository at this point in the history
  • Loading branch information
limbonaut committed Aug 22, 2024
1 parent db8ab18 commit c9eb0b0
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 47 deletions.
30 changes: 30 additions & 0 deletions .github/actions/build-dotnet-assemblies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build .NET assemblies

inputs:
platform:
required: true
type: choice
options:
- linuxbsd
- windows
- macos

runs:
using: "composite"
steps:
- name: Override GODOT_VERSION_STATUS for NuGet packages
shell: bash
run: |
GODOT_VERSION_STATUS=$(echo "${GODOT_VERSION_STATUS}" | sed "s|+|-|")-gha
echo "GODOT_VERSION_STATUS=${GODOT_VERSION_STATUS}" >> "$GITHUB_ENV"
echo "GODOT_VERSION_STATUS: ${GODOT_VERSION_STATUS}"
- name: Generate C# glue
shell: bash
run: |
./bin/$BIN --headless --generate-mono-glue ./modules/mono/glue || true
- name: Build .NET assemblies
shell: bash
run: |
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=${{ inputs.platform }}
11 changes: 0 additions & 11 deletions .github/actions/override-nuget-version/action.yml

This file was deleted.

15 changes: 4 additions & 11 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,11 @@ jobs:
PATH=${GITHUB_WORKSPACE}/buildroot/bin:$PATH
scons platform=linuxbsd target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} module_mono_enabled=${{matrix.opts.dotnet}} ${{env.SCONSFLAGS}}
- name: Override GODOT_VERSION_STATUS for NuGet packages
uses: ./modules/limboai/.github/actions/override-nuget-version

- name: Generate C# glue
if: matrix.opts.dotnet && matrix.opts.target == 'editor'
run: |
./bin/$BIN --headless --generate-mono-glue ./modules/mono/glue || true
- name: Build .NET solutions
- name: Build .NET assemblies
if: matrix.opts.dotnet && matrix.opts.target == 'editor'
run: |
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd
uses: ./modules/limboai/.github/actions/build-dotnet-assemblies
with:
platform: linuxbsd

- name: Prepare artifact
env:
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,18 +183,11 @@ jobs:
run: |
scons -j2 platform=macos target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} module_mono_enabled=${{matrix.opts.dotnet}} ${{env.SCONSFLAGS}}
- name: Override GODOT_VERSION_STATUS for NuGet packages
uses: ./modules/limboai/.github/actions/override-nuget-version

- name: Generate C# glue
if: matrix.opts.dotnet && matrix.opts.target == 'editor' && matrix.opts.arch == 'x86_64'
run: |
./bin/$BIN --headless --generate-mono-glue ./modules/mono/glue || true
- name: Build .NET solutions
if: matrix.opts.dotnet && matrix.opts.target == 'editor' && matrix.opts.arch == 'x86_64'
run: |
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=macos
- name: Build .NET assemblies
if: matrix.opts.dotnet && matrix.opts.target == 'editor'
uses: ./modules/limboai/.github/actions/build-dotnet-assemblies
with:
platform: macos

- name: Prepare artifact
run: |
Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,20 +220,11 @@ jobs:
run: |
scons -j2 platform=windows target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} module_mono_enabled=${{matrix.opts.dotnet}} ${{env.SCONSFLAGS}}
- name: Override GODOT_VERSION_STATUS for NuGet packages
uses: ./modules/limboai/.github/actions/override-nuget-version

- name: Generate C# glue
if: matrix.opts.dotnet && matrix.opts.target == 'editor'
shell: bash
run: |
./bin/${{ env.BIN }} --headless --generate-mono-glue ./modules/mono/glue || true
- name: Build .NET solutions
- name: Build .NET assemblies
if: matrix.opts.dotnet && matrix.opts.target == 'editor'
shell: bash
run: |
python ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=windows
uses: ./modules/limboai/.github/actions/build-dotnet-assemblies
with:
platform: windows

- name: Prepare artifact
shell: bash
Expand Down

0 comments on commit c9eb0b0

Please sign in to comment.