godot-mono-builds/.github/workflows/build.yml
Rémi Verschelde 6236e2ee74
CI: Mono 6.12.0.198, Python 3.11, use ubuntu-latest
- Rediff patches against Mono 6.12.0.198.
- Drop `xcode_13_14_fix.diff` which is included upstream in 6.12.0.198.
2023-05-26 12:59:57 +02:00

787 lines
33 KiB
YAML

name: Build
on:
push:
branches:
- '**'
- '!release/**'
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README.md'
pull_request:
branches:
- '**'
- '!release/**'
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README.md'
create:
branches:
- 'release/**'
env:
# Use SHA or tag instead of the branch for caching purposes.
MONO_TAG: mono-6.12.0.198
PYTHON_VERSION: '3.11'
# Should match the version that Mono supports.
EMSDK_VERSION: 1.39.9
# platform/iphone/detect.py
IOS_VERSION_MIN: 10.0
jobs:
linux:
name: Linux
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86, x86_64]
steps:
- name: Set Environment Variables
run: |
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install git autoconf libtool libtool-bin automake gettext cmake python3 curl
- name: Install Linux SDK (x86_64)
if: matrix.target == 'x86_64'
run: |
cd /home/runner
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
cd x86_64-godot-linux-gnu_sdk-buildroot
./relocate-sdk.sh
cd bin
rm -f {aclocal*,auto*,libtool*,m4}
for file in x86_64-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done
echo "PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV
- name: Install Linux SDK (x86)
if: matrix.target == 'x86'
run: |
cd /home/runner
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/i686-godot-linux-gnu_sdk-buildroot.tar.bz2
tar xf i686-godot-linux-gnu_sdk-buildroot.tar.bz2
rm -f i686-godot-linux-gnu_sdk-buildroot.tar.bz2
cd i686-godot-linux-gnu_sdk-buildroot
./relocate-sdk.sh
cd bin
rm -f {aclocal*,auto*,libtool*,m4}
for file in i686-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done
echo "PATH=/home/runner/i686-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
submodules: true
path: ${{ env.MONO_SOURCE_ROOT }}
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
run:
python3 godot-mono-builds/patch_mono.py
- name: Configure
run:
python3 godot-mono-builds/linux.py configure --target=${{ matrix.target }} -j 2
- name: Make
run:
python3 godot-mono-builds/linux.py make --target=${{ matrix.target }} -j 2
- name: Compress Output
run: |
mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/linux-${{ matrix.target }}.zip desktop-linux-${{ matrix.target }}-release)
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: linux-${{ matrix.target }}
path: ~/mono-installs-artifacts/linux-${{ matrix.target }}.zip
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: linux-${{ matrix.target }}-config.log
path: ~/mono-configs/desktop-linux-${{ matrix.target }}-release/config.log
windows:
name: Windows
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86, x86_64]
steps:
- name: Set Environment Variables
run: |
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies (x86)
if: matrix.target == 'x86'
run: |
sudo dpkg --add-architecture i386
sudo apt-get -y update
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
sudo apt-get -y install mingw-w64
- name: Install Dependencies (x86_64)
if: matrix.target == 'x86_64'
run: |
sudo apt-get -y update
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
sudo apt-get -y install mingw-w64 libz-mingw-w64-dev
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
submodules: true
path: ${{ env.MONO_SOURCE_ROOT }}
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
run:
python3 godot-mono-builds/patch_mono.py
- name: Configure
run:
python3 godot-mono-builds/windows.py configure --target=${{ matrix.target }} -j 2
- name: Make
run:
python3 godot-mono-builds/windows.py make --target=${{ matrix.target }} -j 2
- name: Compress Output
run: |
mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/windows-${{ matrix.target }}.zip desktop-windows-${{ matrix.target }}-release)
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: windows-${{ matrix.target }}
path: ~/mono-installs-artifacts/windows-${{ matrix.target }}.zip
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: windows-${{ matrix.target }}-config.log
path: ~/mono-configs/desktop-windows-${{ matrix.target }}-release/config.log
osx:
name: macOS
runs-on: macos-latest
strategy:
matrix:
target: [arm64, x86_64]
steps:
- name: Set Environment Variables
run: |
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
submodules: true
path: ${{ env.MONO_SOURCE_ROOT }}
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
run:
python3 godot-mono-builds/patch_mono.py
- name: Configure
run:
python3 godot-mono-builds/osx.py configure --target=${{ matrix.target }} -j 2
- name: Make
run:
python3 godot-mono-builds/osx.py make --target=${{ matrix.target }} -j 2
- name: Compress Output
run: |
mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/osx-${{ matrix.target }}.zip desktop-osx-${{ matrix.target }}-release)
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: osx-${{ matrix.target }}
path: ~/mono-installs-artifacts/osx-${{ matrix.target }}.zip
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: osx-${{ matrix.target }}-config.log
path: ~/mono-configs/desktop-osx-${{ matrix.target }}-release/config.log
ios:
name: iOS
runs-on: macos-latest
strategy:
matrix:
target: [arm64, x86_64, arm64-sim]
steps:
- name: Set Environment Variables
run: |
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
submodules: true
path: ${{ env.MONO_SOURCE_ROOT }}
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
run:
python3 godot-mono-builds/patch_mono.py
- name: Configure
run: |
export DISABLE_NO_WEAK_IMPORTS=1
python3 godot-mono-builds/ios.py configure --target=${{ matrix.target }} -j 2 --ios-version-min=${IOS_VERSION_MIN}
- name: Make
run:
python3 godot-mono-builds/ios.py make --target=${{ matrix.target }} -j 2
- name: Compress Output
run: |
mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/ios-${{ matrix.target }}.zip ios-${{ matrix.target }}-release)
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ios-${{ matrix.target }}
path: ~/mono-installs-artifacts/ios-${{ matrix.target }}.zip
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: ios-${{ matrix.target }}-config.log
path: ~/mono-configs/ios-${{ matrix.target }}-release/config.log
ios-cross:
needs: llvm
name: iOS Cross-compiler
runs-on: macos-latest
strategy:
matrix:
target: [cross-arm64]
include:
- target: cross-arm64
llvm: llvm64
runtime_target: arm64
steps:
- name: Set Environment Variables
run: |
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
submodules: true
path: ${{ env.MONO_SOURCE_ROOT }}
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
run:
python3 godot-mono-builds/patch_mono.py
- name: Download LLVM artifact
uses: actions/download-artifact@v3
with:
name: llvm-${{ matrix.llvm }}-macos-latest
# Tilde ~/ not supported when downloading yet: https://github.com/actions/download-artifact/issues/37
# File permissions are also messed up: https://github.com/actions/upload-artifact/issues/38
# We have to manually move the folder and restore the file permissions in the next step.
path: ./llvm-${{ matrix.llvm }}
- name: Stamp LLVM
run: |
mkdir -p $HOME/mono-installs/ && mv ./llvm-${{ matrix.llvm }} $HOME/mono-installs/
chmod 755 $HOME/mono-installs/llvm-${{ matrix.llvm }}/bin/*
mkdir -p $HOME/mono-configs/ && touch $HOME/mono-configs/.stamp-${{ matrix.llvm }}-make
- name: Configure Runtime
run: |
export DISABLE_NO_WEAK_IMPORTS=1
python3 godot-mono-builds/ios.py configure --target=${{ matrix.runtime_target }} -j 2
- name: Configure
run: |
export DISABLE_NO_WEAK_IMPORTS=1
python3 godot-mono-builds/ios.py configure --target=${{ matrix.target }} -j 2
- name: Make
run:
python3 godot-mono-builds/ios.py make --target=${{ matrix.target }} -j 2
- name: Compress Output
run: |
mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/ios-${{ matrix.target }}.zip ios-${{ matrix.target }}-release)
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ios-${{ matrix.target }}
path: ~/mono-installs-artifacts/ios-${{ matrix.target }}.zip
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload Runtime config.log After Error
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: ios-${{ matrix.target }}-runtime-config.log
path: ~/mono-configs/ios-${{ matrix.runtime_target }}-release/config.log
- name: Upload Cross config.log After Error
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: ios-${{ matrix.target }}-config.log
path: ~/mono-configs/ios-${{ matrix.target }}-release/config.log
android:
name: Android
runs-on: ubuntu-latest
strategy:
matrix:
target: [armv7, arm64v8, x86, x86_64]
steps:
- name: Set Environment Variables
run: |
env
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
submodules: true
path: ${{ env.MONO_SOURCE_ROOT }}
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
run:
python3 godot-mono-builds/patch_mono.py
- name: Configure
run:
python3 godot-mono-builds/android.py configure --target=${{ matrix.target }} -j 2
- name: Make
run:
python3 godot-mono-builds/android.py make --target=${{ matrix.target }} -j 2
- name: Compress Output
run: |
mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/android-${{ matrix.target }}.zip android-${{ matrix.target }}-release)
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: android-${{ matrix.target }}
path: ~/mono-installs-artifacts/android-${{ matrix.target }}.zip
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: android-${{ matrix.target }}-config.log
path: ~/mono-configs/android-${{ matrix.target }}-release/config.log
wasm:
name: WebAssembly
runs-on: ubuntu-latest
strategy:
matrix:
target: [runtime, runtime-threads]
steps:
- name: Set Environment Variables
run: |
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
submodules: true
path: ${{ env.MONO_SOURCE_ROOT }}
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup Emscripten SDK
uses: mymindstorm/setup-emsdk@v12
with:
version: ${{ env.EMSDK_VERSION }}
- name: Patch Mono
run:
python3 godot-mono-builds/patch_mono.py
- name: Configure
run:
python3 godot-mono-builds/wasm.py configure --target=${{ matrix.target }} -j 2
- name: Make
run:
python3 godot-mono-builds/wasm.py make --target=${{ matrix.target }} -j 2
- name: Compress Output
run: |
mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/wasm-${{ matrix.target }}.zip wasm-${{ matrix.target }}-release)
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: wasm-${{ matrix.target }}
path: ~/mono-installs-artifacts/wasm-${{ matrix.target }}.zip
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: wasm-${{ matrix.target }}-config.log
path: ~/mono-configs/wasm-${{ matrix.target }}-release/config.log
llvm:
name: LLVM
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
target: [llvm64, llvmwin64]
exclude:
# We already build for Windows on ubuntu-latest
- os: macos-latest
target: llvmwin64
steps:
- name: Cache LLVM
id: cache_llvm
uses: actions/cache@v3
with:
path: ~/mono-installs/llvm-${{ matrix.target }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-llvm-${{ matrix.target }}
- name: Set Environment Variables
run: |
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies (Linux)
if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux'
run: |
sudo apt-get -y update
sudo apt-get -y install git autoconf libtool libtool-bin automake gettext cmake python3 curl
- name: Install Linux SDK (x86_64)
if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux'
run: |
cd /home/runner
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
cd x86_64-godot-linux-gnu_sdk-buildroot
./relocate-sdk.sh
cd bin
rm -f {aclocal*,auto*,libtool*,m4}
for file in x86_64-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done
echo "PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV
- name: Install Dependencies (Linux Targeting Windows)
if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.target == 'llvmwin64'
run: |
sudo apt-get -y install mingw-w64 libz-mingw-w64-dev
- name: Install Dependencies (macOS)
if: steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os == 'macos-latest'
run: |
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
if: steps.cache_llvm.outputs.cache-hit != 'true'
id: cache_mono_sources
uses: actions/cache@v3
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true' && steps.cache_llvm.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
submodules: true
path: ${{ env.MONO_SOURCE_ROOT }}
- name: Clean Mono
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
if: steps.cache_llvm.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
path: godot-mono-builds
- name: Setup Python
if: steps.cache_llvm.outputs.cache-hit != 'true'
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
if: steps.cache_llvm.outputs.cache-hit != 'true'
run:
python3 godot-mono-builds/patch_mono.py
- name: Make
if: steps.cache_llvm.outputs.cache-hit != 'true'
run:
python3 godot-mono-builds/llvm.py make --target=${{ matrix.target }} -j 2
- name: Upload LLVM Artifact
uses: actions/upload-artifact@v3
with:
name: llvm-${{ matrix.target }}-${{ matrix.os }}
path: ~/mono-installs/llvm-${{ matrix.target }}
- name: Clean Mono
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: llvm-${{ matrix.target }}-${{ matrix.os }}-config.log
path: ~/mono-configs/llvm-${{ matrix.target }}/config.log
bcl:
name: BCL
runs-on: ubuntu-latest
strategy:
matrix:
product: [desktop, desktop-win32, android, ios, wasm]
steps:
- name: Set Environment Variables
run: |
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install git autoconf libtool libtool-bin automake gettext cmake python3 curl
- name: Install Linux SDK (x86_64)
run: |
cd /home/runner
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
cd x86_64-godot-linux-gnu_sdk-buildroot
./relocate-sdk.sh
cd bin
rm -f {aclocal*,auto*,libtool*,m4}
for file in x86_64-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done
echo "PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v3
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: mono/mono
ref: ${{ env.MONO_TAG }}
submodules: true
path: ${{ env.MONO_SOURCE_ROOT }}
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout
uses: actions/checkout@v3
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
run:
python3 godot-mono-builds/patch_mono.py
- name: Make Desktop BCL for this Build Platform
if: matrix.product == 'desktop-win32'
run:
python3 godot-mono-builds/bcl.py make --product=desktop -j 2
- name: Make
run:
python3 godot-mono-builds/bcl.py make --product=${{ matrix.product }} -j 2
- name: Compress Output
run: |
mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/bcl-${{ matrix.product }}.zip ${{ matrix.product }}-bcl)
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: bcl-${{ matrix.product }}
path: ~/mono-installs-artifacts/bcl-${{ matrix.product }}.zip
- name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: bcl-${{ matrix.product }}-config.log
path: ~/mono-configs/bcl/config.log
create-release:
if: success() && github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release/')
needs: [linux, windows, osx, ios, ios-cross, android, wasm, bcl]
name: Create Release
runs-on: ubuntu-latest
outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Short SHA
id: short-sha
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: release-${{ steps.short-sha.outputs.sha7 }}
release_name: Release ${{ steps.short-sha.outputs.sha7 }} with ${{ env.MONO_TAG }}
body: |
Mono Version: ${{ env.MONO_TAG }}
EMSDK Version: ${{ env.EMSDK_VERSION }}
iOS Min Version: ${{ env.IOS_VERSION_MIN }}
draft: false
prerelease: false
upload-release-artifacts:
if: success() && github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release/')
needs: create-release
name: Upload Release Artifacts
runs-on: ubuntu-latest
strategy:
matrix:
artifact_name: [linux-x86, linux-x86_64, windows-x86, windows-x86_64, osx-arm64, osx-x86_64,
ios-arm64, ios-x86_64, ios-cross-arm64,
android-armv7, android-arm64v8, android-x86, android-x86_64,
wasm-runtime, wasm-runtime-threads,
bcl-desktop, bcl-desktop-win32, bcl-android, bcl-ios, bcl-wasm]
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: ${{ matrix.artifact_name }}
path: ./
- name: Upload linux-x86
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.release_upload_url }}
asset_path: ./${{ matrix.artifact_name }}.zip
asset_name: ${{ matrix.artifact_name }}.zip
asset_content_type: application/zip