2020-11-06 06:57:25 +01:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
2020-11-22 16:16:38 +01:00
|
|
|
build:
|
2020-11-20 15:34:49 +01:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
platform: [ linux, osx, windows ]
|
2020-11-22 16:16:38 +01:00
|
|
|
target: [ release, debug ]
|
2020-11-20 15:34:49 +01:00
|
|
|
bits: [ 64, 32 ]
|
|
|
|
include:
|
|
|
|
- platform: linux
|
|
|
|
os: ubuntu-latest
|
|
|
|
- platform: osx
|
|
|
|
os: macos-latest
|
|
|
|
- platform: windows
|
|
|
|
os: windows-latest
|
|
|
|
exclude:
|
|
|
|
- platform: osx
|
|
|
|
bits: 32 # Only 64-bit supported on macOS.
|
|
|
|
- platform: windows
|
|
|
|
bits: 32 # TODO: Enable 32-bit build on windows-latest.
|
2020-11-10 04:04:08 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2020-11-20 15:34:49 +01:00
|
|
|
|
|
|
|
- name: Get godot-cpp submodule commit hash
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
2020-11-10 04:04:08 +01:00
|
|
|
run: |
|
2020-11-20 15:34:49 +01:00
|
|
|
echo ::set-env name=GODOT_CPP_COMMIT_HASH::$(git ls-tree HEAD addons/godot_xterm/native/external/godot-cpp -l | cut -d\ -f3)
|
|
|
|
- name: Cache godot-cpp bindings
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: cache
|
|
|
|
env:
|
|
|
|
cache-name: cache-godot-cpp
|
2020-11-10 04:04:08 +01:00
|
|
|
with:
|
2020-11-20 15:34:49 +01:00
|
|
|
path: addons/godot_xterm/native/external/godot-cpp
|
2020-11-22 16:16:38 +01:00
|
|
|
key: godot-cpp-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.bits }}-${{ env.GODOT_CPP_COMMIT_HASH }}
|
2020-11-20 15:34:49 +01:00
|
|
|
|
2020-11-22 16:16:38 +01:00
|
|
|
# Ubuntu-specific steps.
|
2020-11-20 15:34:49 +01:00
|
|
|
- name: Install ubuntu build dependencies
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
run: sudo apt-get install -y scons gcc-multilib g++-multilib
|
|
|
|
|
2020-11-22 16:16:38 +01:00
|
|
|
# MacOS-specific steps.
|
2020-11-20 15:34:49 +01:00
|
|
|
- name: Install additional macos build dependencies
|
|
|
|
if: ${{ matrix.os == 'macos-latest' }}
|
2020-11-20 03:00:03 +01:00
|
|
|
run: brew install scons
|
2020-11-20 15:34:49 +01:00
|
|
|
|
2020-11-22 16:16:38 +01:00
|
|
|
# Windows-specific steps.
|
2020-11-20 15:34:49 +01:00
|
|
|
- name: Install additional windows build dependencies
|
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
2020-11-22 16:45:02 +01:00
|
|
|
run: python -m pip install scons
|
2020-11-20 15:34:49 +01:00
|
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
|
|
|
|
|
|
- name: Build godot-cpp bindings
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
cd addons/godot_xterm/native/external/godot-cpp
|
2020-11-22 16:16:38 +01:00
|
|
|
scons platform=${{ matrix.platform }} target=${{ matrix.target }} bits=${{ matrix.bits }} generate_bindings=yes -j2
|
2020-11-20 15:34:49 +01:00
|
|
|
|
|
|
|
- name: Build libgodot-xterm
|
2020-11-20 03:00:03 +01:00
|
|
|
run: |
|
|
|
|
cd addons/godot_xterm/native
|
2020-11-22 16:16:38 +01:00
|
|
|
scons platform=${{ matrix.platform }} target=${{ matrix.target }} bits=${{ matrix.bits }} -j2
|
2020-11-20 15:34:49 +01:00
|
|
|
|
|
|
|
- name: Upload build artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
2020-11-20 03:00:03 +01:00
|
|
|
with:
|
2020-11-22 16:56:20 +01:00
|
|
|
name: libgodot-xterm-${{ matrix.target }}
|
2020-11-20 15:34:49 +01:00
|
|
|
path: |
|
|
|
|
addons/godot_xterm/native/bin/*.so
|
|
|
|
addons/godot_xterm/native/bin/*.dylib
|
|
|
|
addons/godot_xterm/native/bin/*.dll
|
|
|
|
|