macOS , support both Arm64 and Intel X64 architectures #74
This file contains 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 | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- dotnet-6.x | |
jobs: | |
generate-bindings: | |
name: Generate Bindings | |
runs-on: macos-latest | |
if: contains(github.event.head_commit.message, 'build-test') || github.event_name == 'workflow_dispatch' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Dotnet setup | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Select Xcode version | |
run: | | |
sudo xcode-select --switch /Applications/Xcode.app | |
- name: Create SDK directory | |
run: sudo mkdir -p /Library/Developer/CommandLineTools/usr/share/SDKs/default.sdk/MacOSX.sdk | |
- name: Create SDKSettings.plist file | |
run: sudo touch /Library/Developer/CommandLineTools/usr/share/SDKs/default.sdk/MacOSX.sdk/SDKSettings.plist | |
- name: Set SDKROOT in SDKSettings.plist | |
run: | | |
echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" | sudo tee /Library/Developer/CommandLineTools/usr/share/SDKs/default.sdk/MacOSX.sdk/SDKSettings.plist | |
- name: Symbolic link to OpenGL headers | |
run: sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/OpenGL | |
- name: generate bindings | |
run : | | |
cd Source | |
./script/make_csharp_bindings.sh | |
cd .. | |
- name: Create artifact directory | |
run: | | |
mkdir -p bindings/Source/DotNet/Bindings | |
mkdir -p bindings/Source/Source/Urho3D/DotNet | |
- name: Copy files to artifact directory | |
run: | | |
cp -R Source/DotNet/Bindings/Portable bindings/Source/DotNet/Bindings | |
cp Source/Source/Urho3D/DotNet/binding.cpp bindings/Source/Source/Urho3D/DotNet | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: bindings | |
retention-days: 1 | |
path: | | |
bindings | |
- name: Delete artifact directory | |
run: rm -rf bindings | |
build-macos: | |
name: build install urho.Net macOS | |
runs-on: macos-latest | |
if: contains(github.event.head_commit.message, 'build-test') || github.event_name == 'workflow_dispatch' | |
needs: [generate-bindings] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Dotnet setup | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Select xcode | |
run: sudo xcode-select --switch /Applications/Xcode_14.0.1.app | |
- name: Download Bindings artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings | |
path: bindings | |
- name: Copy Bindings to the destination path | |
run: | | |
ls -ld Source/DotNet/Bindings | |
ls -la Source/Source/Urho3D/DotNet/binding.cpp | |
rm -Rf Source/DotNet/Bindings/Portable | |
cp -R bindings/Source/DotNet/Bindings/Portable Source/DotNet/Bindings | |
cp -f bindings/Source/Source/Urho3D/DotNet/binding.cpp Source/Source/Urho3D/DotNet/ | |
rm -Rf bindings | |
ls -ld Source/DotNet/Bindings | |
ls -la Source/Source/Urho3D/DotNet/binding.cpp | |
- name: build and install macos urho.Net libs | |
run : ./Source/script/build_install_urhonet_macos.sh | |
build-Linux: | |
name: build install urho.Net Linux | |
runs-on: ubuntu-latest | |
if: contains(github.event.head_commit.message, 'build-test') || github.event_name == 'workflow_dispatch' | |
needs: [generate-bindings] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Dotnet setup | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Install dependencies | |
run: sudo apt-get install -y libgl1-mesa-dev libegl1-mesa-dev mesa-common-dev xorg-dev libasound-dev | |
- name: Download Bindings artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings | |
path: bindings | |
- name: Copy Bindings to the destination path | |
run: | | |
ls -ld Source/DotNet/Bindings | |
ls -la Source/Source/Urho3D/DotNet/binding.cpp | |
rm -Rf Source/DotNet/Bindings/Portable | |
cp -R bindings/Source/DotNet/Bindings/Portable Source/DotNet/Bindings | |
cp -f bindings/Source/Source/Urho3D/DotNet/binding.cpp Source/Source/Urho3D/DotNet/ | |
rm -Rf bindings | |
ls -ld Source/DotNet/Bindings | |
ls -la Source/Source/Urho3D/DotNet/binding.cpp | |
- name: build and install Linux urho.Net libs | |
run : ./Source/script/build_install_urhonet_linux.sh | |
build-Windows: | |
name: build install urho.Net Windows | |
runs-on: windows-latest | |
if: contains(github.event.head_commit.message, 'build-test') || github.event_name == 'workflow_dispatch' | |
needs: [generate-bindings] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Dotnet setup | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Install and Configure Mono | |
run: pwsh -File ./Source/script/install_mono.ps1 | |
- name: Install Visual Studio 2019 Build Tools | |
run: | | |
choco install visualstudio2019buildtools --package-parameters "--allWorkloads --includeRecommended --includeOptional" | |
choco install visualstudio2019-workload-vctools --package-parameters "--includeRecommended --includeOptional" | |
- name: Download Bindings artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings | |
path: bindings | |
- name: Copy Bindings to the destination path | |
run: | | |
Remove-Item -Path 'Source\DotNet\Bindings\Portable' -Recurse -Force | |
Copy-Item -Path bindings\Source\DotNet\Bindings\Portable -Destination Source\DotNet\Bindings -Recurse -Force | |
Copy-Item -Path bindings\Source\Source\Urho3D\DotNet\binding.cpp -Destination Source\Source\Urho3D\DotNet -Force | |
Remove-Item -Path 'bindings' -Recurse -Force | |
- name: build and install Windows urho.Net libs | |
run : pwsh -File ./Source/script/build_install_urhonet_windows.ps1 | |
build-android-macos: | |
name: build install Android Urho.Net on macOS | |
runs-on: macos-latest | |
if: contains(github.event.head_commit.message, 'build-test') || github.event_name == 'workflow_dispatch' | |
needs: [generate-bindings] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Print Java version | |
run: echo $JAVA_HOME | |
- name: Setup Android SDK and NDK | |
run : ./Source/script/setup_android_macos.sh | |
- name: Download Bindings artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings | |
path: bindings | |
- name: Copy Bindings to the destination path | |
run: | | |
ls -ld Source/DotNet/Bindings | |
ls -la Source/Source/Urho3D/DotNet/binding.cpp | |
rm -Rf Source/DotNet/Bindings/Portable | |
cp -R bindings/Source/DotNet/Bindings/Portable Source/DotNet/Bindings | |
cp -f bindings/Source/Source/Urho3D/DotNet/binding.cpp Source/Source/Urho3D/DotNet/ | |
rm -Rf bindings | |
ls -ld Source/DotNet/Bindings | |
ls -la Source/Source/Urho3D/DotNet/binding.cpp | |
- name: build and install Android urho.Net libs | |
run : ./Source/script/build_install_urhonet_android_libs.sh | |
build-android-linux: | |
name: build install Android Urho.Net on Linux | |
runs-on: ubuntu-latest | |
if: contains(github.event.head_commit.message, 'build-test') || github.event_name == 'workflow_dispatch' | |
needs: [generate-bindings] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Print Java version | |
run: echo $JAVA_HOME | |
- name: Setup Android SDK and NDK | |
run : ./Source/script/setup_android_linux.sh | |
- name: Install CMake | |
run: sudo apt-get install cmake | |
- name: Use cmake | |
run: cmake --version | |
- name: Download Bindings artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings | |
path: bindings | |
- name: Copy Bindings to the destination path | |
run: | | |
ls -ld Source/DotNet/Bindings | |
ls -la Source/Source/Urho3D/DotNet/binding.cpp | |
rm -Rf Source/DotNet/Bindings/Portable | |
cp -R bindings/Source/DotNet/Bindings/Portable Source/DotNet/Bindings | |
cp -f bindings/Source/Source/Urho3D/DotNet/binding.cpp Source/Source/Urho3D/DotNet/ | |
rm -Rf bindings | |
ls -ld Source/DotNet/Bindings | |
ls -la Source/Source/Urho3D/DotNet/binding.cpp | |
- name: build and install Android urho.Net libs | |
run : ./Source/script/build_install_urhonet_android_libs.sh | |
build-android-Windows: | |
name: build install Android urho.Net on Windows | |
runs-on: windows-latest | |
if: contains(github.event.head_commit.message, 'build-test') || github.event_name == 'workflow_dispatch' | |
needs: [generate-bindings] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Print Java version | |
run: echo $JAVA_HOME | |
- name: Setup Android SDK and NDK | |
run : pwsh -File ./Source/script/setup_android_windows.ps1 | |
- name: Install and Configure Mono | |
run: pwsh -File ./Source/script/install_mono.ps1 | |
- name: Download Bindings artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings | |
path: bindings | |
- name: Copy Bindings to the destination path | |
run: | | |
Remove-Item -Path 'Source\DotNet\Bindings\Portable' -Recurse -Force | |
Copy-Item -Path bindings\Source\DotNet\Bindings\Portable -Destination Source\DotNet\Bindings -Recurse -Force | |
Copy-Item -Path bindings\Source\Source\Urho3D\DotNet\binding.cpp -Destination Source\Source\Urho3D\DotNet -Force | |
Remove-Item -Path 'bindings' -Recurse -Force | |
- name: build and install Windows urho.Net libs | |
run : pwsh -File ./Source/script/build_install_urhonet_android_libs.ps1 | |
build-ios: | |
name: build install urho.Net iOS | |
runs-on: macos-latest | |
if: contains(github.event.head_commit.message, 'build-test') || github.event_name == 'workflow_dispatch' | |
needs: [generate-bindings] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Dotnet setup | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Select xcode | |
run: sudo xcode-select --switch /Applications/Xcode_14.0.1.app | |
- name: Download Bindings artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings | |
path: bindings | |
- name: Copy Bindings to the destination path | |
run: | | |
ls -ld Source/DotNet/Bindings | |
ls -la Source/Source/Urho3D/DotNet/binding.cpp | |
rm -Rf Source/DotNet/Bindings/Portable | |
cp -R bindings/Source/DotNet/Bindings/Portable Source/DotNet/Bindings | |
cp -f bindings/Source/Source/Urho3D/DotNet/binding.cpp Source/Source/Urho3D/DotNet/ | |
rm -Rf bindings | |
ls -ld Source/DotNet/Bindings | |
ls -la Source/Source/Urho3D/DotNet/binding.cpp | |
- name: build and install ios urho.Net libs | |
run : ./Source/script/build_install_urhonet_ios.sh |