mirror of
https://github.com/Relintai/godot-mono-builds.git
synced 2025-01-29 15:49:19 +01:00
Added Github Actions workflow
This commit is contained in:
parent
33622ee670
commit
0e5cd48f05
829
.github/workflows/build.yml
vendored
Normal file
829
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,829 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Use SHA instead of the branch for caching purposes
|
||||||
|
MONO_BRANCH: 2019-10
|
||||||
|
MONO_SHA: 1d0d939dc30a5b56f478bc9f097cab146276b9af
|
||||||
|
PYTHON_VERSION: 3.8
|
||||||
|
EMSDK_VERSION: 1.38.47-upstream
|
||||||
|
ANDROID_PLATFORM: android-29
|
||||||
|
ANDROID_CMAKE_VERSION: 3.6.4111459
|
||||||
|
ANDROID_API: 21
|
||||||
|
IOS_VERSION_MIN: 10.0
|
||||||
|
|
||||||
|
# NOTE: Underscore and brackets to workaround issue in nektos/act': https://github.com/nektos/act/issues/104
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
linux:
|
||||||
|
name: Linux
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target: [x86, x86_64]
|
||||||
|
steps:
|
||||||
|
- name: Set Environment Variables
|
||||||
|
run: |
|
||||||
|
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
|
||||||
|
- 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 gcc-multilib g++-multilib zlib1g-dev:i386
|
||||||
|
- 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
|
||||||
|
- name: Cache Mono Sources
|
||||||
|
id: cache_mono_sources
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
key: ${{ runner.os }}-${{ env.MONO_SHA }}-mono-sources
|
||||||
|
- name: Checkout Mono Sources
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: mono/mono
|
||||||
|
ref: ${{ env.MONO_SHA }}
|
||||||
|
submodules: true
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: godot-mono-builds
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
- name: Patch Mono
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
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@v2
|
||||||
|
with:
|
||||||
|
name: linux-${{ matrix.target }}
|
||||||
|
path: ~/mono-installs-artifacts/linux-${{ matrix.target }}.zip
|
||||||
|
- name: Upload config.log After Error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
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 "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
|
||||||
|
- name: Install Dependencies (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)
|
||||||
|
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@v1
|
||||||
|
with:
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
key: ${{ runner.os }}-${{ env.MONO_SHA }}-mono-sources
|
||||||
|
- name: Checkout Mono Sources
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: mono/mono
|
||||||
|
ref: ${{ env.MONO_SHA }}
|
||||||
|
submodules: true
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: godot-mono-builds
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
- name: Patch Mono
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
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@v2
|
||||||
|
with:
|
||||||
|
name: windows-${{ matrix.target }}
|
||||||
|
path: ~/mono-installs-artifacts/windows-${{ matrix.target }}.zip
|
||||||
|
- name: Upload config.log After Error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
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: [x86_64]
|
||||||
|
steps:
|
||||||
|
- name: Set Environment Variables
|
||||||
|
run: |
|
||||||
|
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
brew install autoconf automake libtool pkg-config cmake python3
|
||||||
|
- name: Cache Mono Sources
|
||||||
|
id: cache_mono_sources
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
key: ${{ runner.os }}-${{ env.MONO_SHA }}-mono-sources
|
||||||
|
- name: Checkout Mono Sources
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: mono/mono
|
||||||
|
ref: ${{ env.MONO_SHA }}
|
||||||
|
submodules: true
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: godot-mono-builds
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
- name: Patch Mono
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
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@v2
|
||||||
|
with:
|
||||||
|
name: osx-${{ matrix.target }}
|
||||||
|
path: ~/mono-installs-artifacts/osx-${{ matrix.target }}.zip
|
||||||
|
- name: Upload config.log After Error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
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]
|
||||||
|
steps:
|
||||||
|
- name: Set Environment Variables
|
||||||
|
run: |
|
||||||
|
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
brew install autoconf automake libtool pkg-config cmake python3
|
||||||
|
- name: Cache Mono Sources
|
||||||
|
id: cache_mono_sources
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
key: ${{ runner.os }}-${{ env.MONO_SHA }}-mono-sources
|
||||||
|
- name: Checkout Mono Sources
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: mono/mono
|
||||||
|
ref: ${{ env.MONO_SHA }}
|
||||||
|
submodules: true
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: godot-mono-builds
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
- name: Patch Mono
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
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@v2
|
||||||
|
with:
|
||||||
|
name: ios-${{ matrix.target }}
|
||||||
|
path: ~/mono-installs-artifacts/ios-${{ matrix.target }}.zip
|
||||||
|
- name: Upload config.log After Error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
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 "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
brew install autoconf automake libtool pkg-config cmake python3
|
||||||
|
- name: Cache Mono Sources
|
||||||
|
id: cache_mono_sources
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
key: ${{ runner.os }}-${{ env.MONO_SHA }}-mono-sources
|
||||||
|
- name: Checkout Mono Sources
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: mono/mono
|
||||||
|
ref: ${{ env.MONO_SHA }}
|
||||||
|
submodules: true
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: godot-mono-builds
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
- name: Patch Mono
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
run:
|
||||||
|
python3 godot-mono-builds/patch_mono.py
|
||||||
|
- name: Download LLVM artifact
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
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@v2
|
||||||
|
with:
|
||||||
|
name: ios-${{ matrix.target }}
|
||||||
|
path: ~/mono-installs-artifacts/ios-${{ matrix.target }}.zip
|
||||||
|
- name: Upload Runtime config.log After Error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
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@v2
|
||||||
|
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: [armeabi-v7a, arm64-v8a, x86, x86_64]
|
||||||
|
steps:
|
||||||
|
- name: Set Environment Variables
|
||||||
|
run: |
|
||||||
|
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
|
||||||
|
- 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
|
||||||
|
sudo apt-get -y install snapd
|
||||||
|
- name: Install Android SDK Manager
|
||||||
|
run: |
|
||||||
|
sudo snap install androidsdk
|
||||||
|
androidsdk "platforms;${ANDROID_PLATFORM}"
|
||||||
|
androidsdk "ndk-bundle"
|
||||||
|
androidsdk "cmake;${ANDROID_CMAKE_VERSION}"
|
||||||
|
echo "::set-env name=ANDROID_SDK_ROOT::$HOME/snap/androidsdk/current/"
|
||||||
|
echo "::set-env name=ANDROID_NDK_ROOT::$ANDROID_SDK_ROOT/ndk-bundle"
|
||||||
|
- name: Cache Mono Sources
|
||||||
|
id: cache_mono_sources
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
key: ${{ runner.os }}-${{ env.MONO_SHA }}-mono-sources
|
||||||
|
- name: Checkout Mono Sources
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: mono/mono
|
||||||
|
ref: ${{ env.MONO_SHA }}
|
||||||
|
submodules: true
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: godot-mono-builds
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
- name: Patch Mono
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
run:
|
||||||
|
python3 godot-mono-builds/patch_mono.py
|
||||||
|
- name: Configure
|
||||||
|
run:
|
||||||
|
python3 godot-mono-builds/android.py configure --target=${{ matrix.target }} -j 2 --android-api-version=${ANDROID_API} --android-cmake-version=${ANDROID_CMAKE_VERSION}
|
||||||
|
- name: Make
|
||||||
|
run:
|
||||||
|
python3 godot-mono-builds/android.py make --target=${{ matrix.target }} -j 2 --android-api-version=${ANDROID_API} --android-cmake-version=${ANDROID_CMAKE_VERSION}
|
||||||
|
- 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@v2
|
||||||
|
with:
|
||||||
|
name: android-${{ matrix.target }}
|
||||||
|
path: ~/mono-installs-artifacts/android-${{ matrix.target }}.zip
|
||||||
|
- name: Upload config.log After Error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: android-${{ matrix.target }}-config.log
|
||||||
|
path: ~/mono-configs/android-${{ matrix.target }}-release/config.log
|
||||||
|
|
||||||
|
android-cross:
|
||||||
|
needs: llvm
|
||||||
|
name: Android Cross-compiler
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target: [cross-arm, cross-arm64, cross-x86, cross-x86_64, cross-arm-win, cross-arm64-win, cross-x86-win, cross-x86_64-win]
|
||||||
|
include:
|
||||||
|
- target: cross-arm
|
||||||
|
llvm: llvm64
|
||||||
|
runtime_target: armeabi-v7a
|
||||||
|
- target: cross-arm64
|
||||||
|
llvm: llvm64
|
||||||
|
runtime_target: arm64-v8a
|
||||||
|
- target: cross-x86
|
||||||
|
llvm: llvm64
|
||||||
|
runtime_target: x86
|
||||||
|
- target: cross-x86_64
|
||||||
|
llvm: llvm64
|
||||||
|
runtime_target: x86_64
|
||||||
|
- target: cross-arm-win
|
||||||
|
llvm: llvmwin64
|
||||||
|
runtime_target: armeabi-v7a
|
||||||
|
- target: cross-arm64-win
|
||||||
|
llvm: llvmwin64
|
||||||
|
runtime_target: arm64-v8a
|
||||||
|
- target: cross-x86-win
|
||||||
|
llvm: llvmwin64
|
||||||
|
runtime_target: x86
|
||||||
|
- target: cross-x86_64-win
|
||||||
|
llvm: llvmwin64
|
||||||
|
runtime_target: x86_64
|
||||||
|
steps:
|
||||||
|
- name: Set Environment Variables
|
||||||
|
run: |
|
||||||
|
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
|
||||||
|
- 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: Install Dependencies (Targeting Windows)
|
||||||
|
if: matrix.llvm == 'llvmwin64'
|
||||||
|
run: |
|
||||||
|
sudo apt-get -y install mingw-w64 libz-mingw-w64-dev
|
||||||
|
- name: Install Android SDK Manager
|
||||||
|
run: |
|
||||||
|
sudo apt-get -y install snapd
|
||||||
|
sudo snap install androidsdk
|
||||||
|
androidsdk "platforms;${ANDROID_PLATFORM}"
|
||||||
|
androidsdk "ndk-bundle"
|
||||||
|
androidsdk "cmake;${ANDROID_CMAKE_VERSION}"
|
||||||
|
echo "::set-env name=ANDROID_SDK_ROOT::$HOME/snap/androidsdk/current/"
|
||||||
|
echo "::set-env name=ANDROID_NDK_ROOT::$ANDROID_SDK_ROOT/ndk-bundle"
|
||||||
|
- name: Cache Mono Sources
|
||||||
|
id: cache_mono_sources
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
key: ${{ runner.os }}-${{ env.MONO_SHA }}-mono-sources
|
||||||
|
- name: Checkout Mono Sources
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: mono/mono
|
||||||
|
ref: ${{ env.MONO_SHA }}
|
||||||
|
submodules: true
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: godot-mono-builds
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
- name: Download LLVM artifact
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: llvm-${{ matrix.llvm }}-ubuntu-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: Patch Mono
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
run:
|
||||||
|
python3 godot-mono-builds/patch_mono.py
|
||||||
|
- name: Configure Runtime
|
||||||
|
run:
|
||||||
|
python3 godot-mono-builds/android.py configure --target=${{ matrix.runtime_target }} -j 2 --android-api-version=${ANDROID_API} --android-cmake-version=${ANDROID_CMAKE_VERSION}
|
||||||
|
- name: Configure
|
||||||
|
run:
|
||||||
|
python3 godot-mono-builds/android.py configure --target=${{ matrix.target }} -j 2 --android-api-version=${ANDROID_API} --android-cmake-version=${ANDROID_CMAKE_VERSION}
|
||||||
|
- name: Make
|
||||||
|
run:
|
||||||
|
python3 godot-mono-builds/android.py make --target=${{ matrix.target }} -j 2 --android-api-version=${ANDROID_API} --android-cmake-version=${ANDROID_CMAKE_VERSION}
|
||||||
|
- 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@v2
|
||||||
|
with:
|
||||||
|
name: android-${{ matrix.target }}
|
||||||
|
path: ~/mono-installs-artifacts/android-${{ matrix.target }}.zip
|
||||||
|
- name: Upload Runtime config.log After Error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: android-${{ matrix.target }}-runtime-config.log
|
||||||
|
path: ~/mono-configs/android-${{ matrix.runtime_target }}-release/config.log
|
||||||
|
- name: Upload Cross config.log After Error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
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 "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
|
||||||
|
- 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@v1
|
||||||
|
with:
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
key: ${{ runner.os }}-${{ env.MONO_SHA }}-mono-sources
|
||||||
|
- name: Checkout Mono Sources
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: mono/mono
|
||||||
|
ref: ${{ env.MONO_SHA }}
|
||||||
|
submodules: true
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: godot-mono-builds
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
- name: Setup Emscripten SDK
|
||||||
|
uses: mymindstorm/setup-emsdk@v2
|
||||||
|
with:
|
||||||
|
version: ${{ env.EMSDK_VERSION }}
|
||||||
|
- name: Patch Mono
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
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@v2
|
||||||
|
with:
|
||||||
|
name: wasm-${{ matrix.target }}
|
||||||
|
path: ~/mono-installs-artifacts/wasm-${{ matrix.target }}.zip
|
||||||
|
- name: Upload config.log After Error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
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:
|
||||||
|
- os: macos-latest
|
||||||
|
target: llvmwin64
|
||||||
|
steps:
|
||||||
|
- name: Cache LLVM
|
||||||
|
id: cache_llvm
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/mono-installs/llvm-${{ matrix.target }}
|
||||||
|
key: ${{ runner.os }}-${{ env.MONO_SHA }}-llvm-${{ matrix.target }}
|
||||||
|
- name: Set Environment Variables
|
||||||
|
run: |
|
||||||
|
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
|
||||||
|
- name: Install Dependencies (Linux)
|
||||||
|
if: steps.cache_llvm.outputs['cache-hit'] != 'true' && matrix.os == 'ubuntu-latest'
|
||||||
|
run: |
|
||||||
|
sudo apt-get -y update
|
||||||
|
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
|
||||||
|
- name: Install Dependencies (Linux Targeting Windows)
|
||||||
|
if: steps.cache_llvm.outputs['cache-hit'] != 'true' && matrix.os == 'ubuntu-latest' && 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@v1
|
||||||
|
with:
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
key: ${{ runner.os }}-${{ env.MONO_SHA }}-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@v2
|
||||||
|
with:
|
||||||
|
repository: mono/mono
|
||||||
|
ref: ${{ env.MONO_SHA }}
|
||||||
|
submodules: true
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
- name: Checkout
|
||||||
|
if: steps.cache_llvm.outputs['cache-hit'] != 'true'
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: godot-mono-builds
|
||||||
|
- name: Setup Python
|
||||||
|
if: steps.cache_llvm.outputs['cache-hit'] != 'true'
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
- name: Patch Mono
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true' && 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@v2
|
||||||
|
with:
|
||||||
|
name: llvm-${{ matrix.target }}-${{ matrix.os }}
|
||||||
|
path: ~/mono-installs/llvm-${{ matrix.target }}
|
||||||
|
- name: Upload config.log After Error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
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:
|
||||||
|
# desktop-win32 is disabled until build is fixed
|
||||||
|
product: [desktop, android, ios, wasm]
|
||||||
|
steps:
|
||||||
|
- name: Set Environment Variables
|
||||||
|
run: |
|
||||||
|
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
|
||||||
|
- name: Install Dependencies (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
|
||||||
|
- name: Cache Mono Sources
|
||||||
|
id: cache_mono_sources
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
key: ${{ runner.os }}-${{ env.MONO_SHA }}-mono-sources
|
||||||
|
- name: Checkout Mono Sources
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: mono/mono
|
||||||
|
ref: ${{ env.MONO_SHA }}
|
||||||
|
submodules: true
|
||||||
|
path: ${{ env.MONO_SOURCE_ROOT }}
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: godot-mono-builds
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
- name: Patch Mono
|
||||||
|
if: steps.cache_mono_sources.outputs['cache-hit'] != 'true'
|
||||||
|
run:
|
||||||
|
python3 godot-mono-builds/patch_mono.py
|
||||||
|
- 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@v2
|
||||||
|
with:
|
||||||
|
name: bcl-${{ matrix.product }}
|
||||||
|
path: ~/mono-installs-artifacts/bcl-${{ matrix.product }}.zip
|
||||||
|
- name: Upload config.log After Error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: bcl-${{ matrix.product }}-config.log
|
||||||
|
path: ~/mono-configs/bcl/config.log
|
||||||
|
|
||||||
|
create-release:
|
||||||
|
if: success() && github.ref == 'refs/heads/release' && github.event_name == 'push'
|
||||||
|
needs: [linux, windows, osx, ios, ios-cross, android, android-cross, 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=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||||
|
- 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.sha8 }}
|
||||||
|
release_name: Release ${{ steps.short-sha.outputs.sha8 }}
|
||||||
|
body: |
|
||||||
|
Mono:
|
||||||
|
- Branch: ${{ env.MONO_BRANCH }}
|
||||||
|
- Commit: ${{ env.MONO_SHA }}
|
||||||
|
|
||||||
|
EMSDK Version: 1.38.47-upstream
|
||||||
|
Android Platform: android-29
|
||||||
|
Android CMake Version: 3.6.4111459
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
|
||||||
|
upload-release-artifacts:
|
||||||
|
if: success() && github.ref == 'refs/heads/release' && github.event_name == 'push'
|
||||||
|
needs: create-release
|
||||||
|
name: Upload Release Artifacts
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
# bcl-desktop-win32 is disabled until build is fixed
|
||||||
|
artifact_name: [linux-x86, linux-x86_64, windows-x86, windows-x86_64, osx-x86_64,
|
||||||
|
ios-arm64, ios-x86_64, ios-cross-arm64,
|
||||||
|
android-armeabi-v7a, android-arm64-v8a, android-x86, android-x86_64,
|
||||||
|
android-cross-arm, android-cross-arm64, android-cross-x86, android-cross-x86_64,
|
||||||
|
android-cross-arm-win, android-cross-arm64-win, android-cross-x86-win, android-cross-x86_64-win,
|
||||||
|
wasm-runtime, wasm-runtime-threads,
|
||||||
|
bcl-desktop, bcl-android, bcl-ios, bcl-wasm]
|
||||||
|
steps:
|
||||||
|
- name: Download Artifact
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
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
|
@ -31,12 +31,12 @@ export MONO_SOURCE_ROOT=$HOME/git/mono
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build the runtimes for 32-bit and 64-bit Linux.
|
# Build the runtimes for 32-bit and 64-bit Linux.
|
||||||
./linux.py configure --target=i686 --target=x86_64
|
./linux.py configure --target=x86 --target=x86_64
|
||||||
./linux.py make --target=i686 --target=x86_64
|
./linux.py make --target=x86 --target=x86_64
|
||||||
|
|
||||||
# Build the runtimes for 32-bit and 64-bit Windows.
|
# Build the runtimes for 32-bit and 64-bit Windows.
|
||||||
./windows.py configure --target=i686 --target=x86_64 --mxe-prefix=/usr
|
./windows.py configure --target=x86 --target=x86_64 --mxe-prefix=/usr
|
||||||
./windows.py make --target=i686 --target=x86_64 --mxe-prefix=/usr
|
./windows.py make --target=x86 --target=x86_64 --mxe-prefix=/usr
|
||||||
|
|
||||||
# Build the runtime for 64-bit macOS.
|
# Build the runtime for 64-bit macOS.
|
||||||
./osx.py configure --target=x86_64
|
./osx.py configure --target=x86_64
|
||||||
|
@ -280,6 +280,9 @@ def get_android_libclang_path(opts):
|
|||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
return '%s/toolchains/llvm/prebuilt/darwin-x86_64/lib64/libclang.dylib' % opts.android_ndk_root
|
return '%s/toolchains/llvm/prebuilt/darwin-x86_64/lib64/libclang.dylib' % opts.android_ndk_root
|
||||||
elif sys.platform in ['linux', 'linux2']:
|
elif sys.platform in ['linux', 'linux2']:
|
||||||
|
loc = '%s/toolchains/llvm/prebuilt/linux-x86_64/lib64/libclang.so.9svn' % opts.android_ndk_root
|
||||||
|
if os.path.isfile(loc):
|
||||||
|
return loc
|
||||||
return '%s/toolchains/llvm/prebuilt/linux-x86_64/lib64/libclang.so.8svn' % opts.android_ndk_root
|
return '%s/toolchains/llvm/prebuilt/linux-x86_64/lib64/libclang.so.8svn' % opts.android_ndk_root
|
||||||
assert False
|
assert False
|
||||||
|
|
||||||
@ -519,7 +522,7 @@ def main(raw_args):
|
|||||||
parser.add_argument('--toolchains-prefix', default=path_join(home, 'android-toolchains'), help=default_help)
|
parser.add_argument('--toolchains-prefix', default=path_join(home, 'android-toolchains'), help=default_help)
|
||||||
parser.add_argument('--android-sdk', default=android_sdk_default, help=default_help)
|
parser.add_argument('--android-sdk', default=android_sdk_default, help=default_help)
|
||||||
parser.add_argument('--android-ndk', default=android_ndk_default, help=default_help)
|
parser.add_argument('--android-ndk', default=android_ndk_default, help=default_help)
|
||||||
parser.add_argument('--android-api-version', default='18', help=default_help)
|
parser.add_argument('--android-api-version', default='21', help=default_help)
|
||||||
parser.add_argument('--android-cmake-version', default='autodetect', help=default_help)
|
parser.add_argument('--android-cmake-version', default='autodetect', help=default_help)
|
||||||
|
|
||||||
cmd_utils.add_runtime_arguments(parser, default_help)
|
cmd_utils.add_runtime_arguments(parser, default_help)
|
||||||
|
32
desktop.py
32
desktop.py
@ -13,11 +13,25 @@ import runtime
|
|||||||
# TODO: mono cross-compilers
|
# TODO: mono cross-compilers
|
||||||
|
|
||||||
targets = {
|
targets = {
|
||||||
'linux': ['i686', 'x86_64'],
|
'linux': ['x86', 'x86_64'],
|
||||||
'windows': ['i686', 'x86_64'],
|
'windows': ['x86', 'x86_64'],
|
||||||
'osx': ['x86_64']
|
'osx': ['x86_64']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target_arch = {
|
||||||
|
'linux': {
|
||||||
|
'x86': 'i686',
|
||||||
|
'x86_64': 'x86_64'
|
||||||
|
},
|
||||||
|
'windows': {
|
||||||
|
'x86': 'i686',
|
||||||
|
'x86_64': 'x86_64'
|
||||||
|
},
|
||||||
|
'osx': {
|
||||||
|
'x86_64': 'x86_64'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
host_triples = {
|
host_triples = {
|
||||||
'linux': '%s-linux-gnu',
|
'linux': '%s-linux-gnu',
|
||||||
'windows': '%s-w64-mingw32',
|
'windows': '%s-w64-mingw32',
|
||||||
@ -26,11 +40,11 @@ host_triples = {
|
|||||||
|
|
||||||
llvm_table = {
|
llvm_table = {
|
||||||
'linux': {
|
'linux': {
|
||||||
'i686': 'llvm32',
|
'x86': 'llvm32',
|
||||||
'x86_64': 'llvm64'
|
'x86_64': 'llvm64'
|
||||||
},
|
},
|
||||||
'windows': {
|
'windows': {
|
||||||
'i686': 'llvm32',
|
'x86': 'llvm32',
|
||||||
'x86_64': 'llvm64'
|
'x86_64': 'llvm64'
|
||||||
},
|
},
|
||||||
'osx': {
|
'osx': {
|
||||||
@ -56,7 +70,7 @@ def get_osxcross_sdk(osxcross_bin, arch):
|
|||||||
|
|
||||||
|
|
||||||
def setup_desktop_template(env: dict, opts: DesktopOpts, product: str, target_platform: str, target: str):
|
def setup_desktop_template(env: dict, opts: DesktopOpts, product: str, target_platform: str, target: str):
|
||||||
host_triple = host_triples[target_platform] % target
|
host_triple = host_triples[target_platform] % target_arch[target_platform][target]
|
||||||
|
|
||||||
CONFIGURE_FLAGS = [
|
CONFIGURE_FLAGS = [
|
||||||
'--disable-boehm',
|
'--disable-boehm',
|
||||||
@ -83,7 +97,7 @@ def setup_desktop_template(env: dict, opts: DesktopOpts, product: str, target_pl
|
|||||||
|
|
||||||
env['_%s-%s_PATH' % (product, target)] = mxe_bin
|
env['_%s-%s_PATH' % (product, target)] = mxe_bin
|
||||||
|
|
||||||
name_fmt = path_join(mxe_bin, target + '-w64-mingw32-%s')
|
name_fmt = path_join(mxe_bin, target_arch[target_platform][target] + '-w64-mingw32-%s')
|
||||||
|
|
||||||
env['_%s-%s_AR' % (product, target)] = name_fmt % 'ar'
|
env['_%s-%s_AR' % (product, target)] = name_fmt % 'ar'
|
||||||
env['_%s-%s_AS' % (product, target)] = name_fmt % 'as'
|
env['_%s-%s_AS' % (product, target)] = name_fmt % 'as'
|
||||||
@ -103,12 +117,12 @@ def setup_desktop_template(env: dict, opts: DesktopOpts, product: str, target_pl
|
|||||||
osxcross_root = os.environ['OSXCROSS_ROOT']
|
osxcross_root = os.environ['OSXCROSS_ROOT']
|
||||||
osx_toolchain_path = path_join(osxcross_root, 'target')
|
osx_toolchain_path = path_join(osxcross_root, 'target')
|
||||||
osxcross_bin = path_join(osx_toolchain_path, 'bin')
|
osxcross_bin = path_join(osx_toolchain_path, 'bin')
|
||||||
osx_triple_abi = 'darwin%s' % get_osxcross_sdk(osxcross_bin, arch=target) # TODO: Replace with '--osx-triple-abi' as in ios.py
|
osx_triple_abi = 'darwin%s' % get_osxcross_sdk(osxcross_bin, arch=target_arch[target_platform][target]) # TODO: Replace with '--osx-triple-abi' as in ios.py
|
||||||
|
|
||||||
env['_%s-%s_PATH' % (product, target)] = osxcross_bin
|
env['_%s-%s_PATH' % (product, target)] = osxcross_bin
|
||||||
|
|
||||||
wrapper_path = create_osxcross_wrapper(opts, product, target, osx_toolchain_path)
|
wrapper_path = create_osxcross_wrapper(opts, product, target, osx_toolchain_path)
|
||||||
name_fmt = path_join(osxcross_bin, target + '-apple-' + osx_triple_abi + '-%s')
|
name_fmt = path_join(osxcross_bin, target_arch[target_platform][target] + '-apple-' + osx_triple_abi + '-%s')
|
||||||
name_fmt = "%s %s" % (wrapper_path, name_fmt)
|
name_fmt = "%s %s" % (wrapper_path, name_fmt)
|
||||||
|
|
||||||
env['_%s-%s_AR' % (product, target)] = name_fmt % 'ar'
|
env['_%s-%s_AR' % (product, target)] = name_fmt % 'ar'
|
||||||
@ -139,7 +153,7 @@ def strip_libs(opts: DesktopOpts, product: str, target_platform: str, target: st
|
|||||||
|
|
||||||
if is_cross_compiling(target_platform) and target_platform == 'windows':
|
if is_cross_compiling(target_platform) and target_platform == 'windows':
|
||||||
mxe_bin = path_join(opts.mxe_prefix, 'bin')
|
mxe_bin = path_join(opts.mxe_prefix, 'bin')
|
||||||
name_fmt = path_join(mxe_bin, target + '-w64-mingw32-%s')
|
name_fmt = path_join(mxe_bin, target_arch[target_platform][target] + '-w64-mingw32-%s')
|
||||||
strip = name_fmt % 'strip'
|
strip = name_fmt % 'strip'
|
||||||
else:
|
else:
|
||||||
strip = 'strip'
|
strip = 'strip'
|
||||||
|
22
files/patches/offsets-tool-extra-cflags_new.diff
Normal file
22
files/patches/offsets-tool-extra-cflags_new.diff
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
diff --git a/mono/tools/offsets-tool/offsets-tool.py b/mono/tools/offsets-tool/offsets-tool.py
|
||||||
|
index 35445ba585c..d1586ee5ecd 100644
|
||||||
|
--- a/mono/tools/offsets-tool/offsets-tool.py
|
||||||
|
+++ b/mono/tools/offsets-tool/offsets-tool.py
|
||||||
|
@@ -54,6 +54,7 @@ class OffsetsTool:
|
||||||
|
sys.exit (1)
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser ()
|
||||||
|
+ parser.add_argument ('--extra-cflag=', dest='extra_cflags', action='append', help='extra flags for clang')
|
||||||
|
parser.add_argument ('--libclang', dest='libclang', help='path to shared library of libclang.{so,dylib}')
|
||||||
|
parser.add_argument ('--emscripten-sdk', dest='emscripten_path', help='path to emscripten sdk')
|
||||||
|
parser.add_argument ('--outfile', dest='outfile', help='path to output file', required=True)
|
||||||
|
@@ -78,6 +79,9 @@ class OffsetsTool:
|
||||||
|
self.target_args = []
|
||||||
|
android_api_level = "-D__ANDROID_API=21"
|
||||||
|
|
||||||
|
+ if args.extra_cflags:
|
||||||
|
+ self.target_args += args.extra_cflags
|
||||||
|
+
|
||||||
|
if "wasm" in args.abi:
|
||||||
|
require_emscipten_path (args)
|
||||||
|
self.sys_includes = [args.emscripten_path + "/system/include", args.emscripten_path + "/system/include/libc", args.emscripten_path + "/system/lib/libc/musl/arch/emscripten"]
|
22
files/patches/offsets-tool-extra-cflags_old.diff
Normal file
22
files/patches/offsets-tool-extra-cflags_old.diff
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
diff --git a/tools/offsets-tool-py/offsets-tool.py b/tools/offsets-tool-py/offsets-tool.py
|
||||||
|
index 536206aa5c9..04e515f13f2 100644
|
||||||
|
--- a/tools/offsets-tool-py/offsets-tool.py
|
||||||
|
+++ b/tools/offsets-tool-py/offsets-tool.py
|
||||||
|
@@ -61,6 +61,7 @@ class OffsetsTool:
|
||||||
|
parser.add_argument ('--targetdir', dest='target_path', help='path to mono tree configured for target', required=True)
|
||||||
|
parser.add_argument ('--abi=', dest='abi', help='ABI triple to generate', required=True)
|
||||||
|
parser.add_argument ('--sysroot=', dest='sysroot', help='path to sysroot headers of target')
|
||||||
|
+ parser.add_argument ('--extra-cflag=', dest='extra_cflags', action='append', help='extra flags for clang')
|
||||||
|
args = parser.parse_args ()
|
||||||
|
|
||||||
|
if not args.libclang or not os.path.isfile (args.libclang):
|
||||||
|
@@ -78,6 +79,9 @@ class OffsetsTool:
|
||||||
|
self.target_args = []
|
||||||
|
android_api_level = "-D__ANDROID_API=21"
|
||||||
|
|
||||||
|
+ if args.extra_cflags:
|
||||||
|
+ self.target_args += args.extra_cflags
|
||||||
|
+
|
||||||
|
if "wasm" in args.abi:
|
||||||
|
require_emscipten_path (args)
|
||||||
|
self.sys_includes = [args.emscripten_path + "/system/include/libc"]
|
9
ios.py
9
ios.py
@ -121,8 +121,13 @@ def setup_ios_device_template(env: dict, opts: iOSOpts, target: str):
|
|||||||
'-DSMALL_CONFIG', '-D_XOPEN_SOURCE', '-DHOST_IOS', '-DHAVE_LARGE_FILE_SUPPORT=1'
|
'-DSMALL_CONFIG', '-D_XOPEN_SOURCE', '-DHOST_IOS', '-DHAVE_LARGE_FILE_SUPPORT=1'
|
||||||
]
|
]
|
||||||
|
|
||||||
LDFLAGS = [
|
LDFLAGS = []
|
||||||
'-Wl,-no_weak_imports',
|
|
||||||
|
# https://github.com/mono/mono/issues/19393
|
||||||
|
if os.environ.get('DISABLE_NO_WEAK_IMPORTS', '0') != '1':
|
||||||
|
LDFLAGS += ['-Wl,-no_weak_imports']
|
||||||
|
|
||||||
|
LDFLAGS += [
|
||||||
'-arch %s' % arch,
|
'-arch %s' % arch,
|
||||||
'-framework', 'CoreFoundation',
|
'-framework', 'CoreFoundation',
|
||||||
'-lobjc', '-lc++'
|
'-lobjc', '-lc++'
|
||||||
|
Loading…
Reference in New Issue
Block a user