More respect env var changes #124
Workflow file for this run
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: SDL2 | |
on: | |
push: | |
branches-ignore: | |
- "ci/**" | |
- "develop/**" | |
- "main" | |
paths: | |
- build/submodules/SDL | |
- "build/cmake/*" | |
- build/nuke/Native/Core.cs | |
- build/nuke/Native/SDL2.cs | |
- build/nuke/Native/SilkDroid.cs | |
- build/nuke/Build.Support.cs | |
- .github/workflows/sdl2.yml | |
jobs: | |
Build: | |
if: github.repository == 'dotnet/Silk.NET' | |
strategy: | |
fail-fast: false | |
matrix: | |
env: | |
- os: ubuntu-22.04 | |
name: Linux | |
nuke_invoke: ./build.sh | |
- os: windows-latest # runner is not setup for android yet | |
name: Windows | |
nuke_invoke: ./build.cmd BuildLibSilkDroid | |
- os: macos-14 | |
name: Darwin | |
nuke_invoke: ./build.sh | |
name: ${{ matrix.env.name }} Build | |
runs-on: ${{ matrix.env.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.PUSHABLE_GITHUB_TOKEN }} | |
- name: Checkout submodules, configure git | |
run: | | |
git -c submodule.third_party/git-hooks.update=none submodule update --init --recursive build/submodules/SDL | |
git config --local user.email "[email protected]" | |
git config --local user.name "The Silk.NET Automaton" | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
if: runner.os == 'Windows' | |
with: | |
dotnet-version: 6.0.x | |
env: | |
DOTNET_INSTALL_DIR: ~/.dotnet | |
- name: Setup PowerShell Core | |
continue-on-error: true | |
if: runner.os == 'Windows' | |
run: dotnet tool install --global PowerShell | |
- name: Setup Java JDK 21 | |
uses: actions/[email protected] | |
if: runner.os == 'Windows' | |
with: | |
java-version: 21 | |
distribution: "temurin" | |
- name: Set PATH | |
if: runner.os == 'Windows' | |
id: set_path | |
run: | | |
echo "cur_path=$env:PATH\n" >> $env:GITHUB_OUTPUT | |
- name: Setup Android Environment | |
uses: android-actions/setup-android@v3 | |
if: runner.os == 'Windows' | |
env: | |
PATH: "${{ env.DOTNET_ROOT }};${{ env.DOTNET_ROOT }}\\tools;${{ steps.set_path.outputs.cur_path }}" | |
- name: Install Android Platforms | |
if: runner.os == 'Windows' | |
run: | | |
sdkmanager --install "build-tools;32.0.0" | |
sdkmanager --install "platform-tools" | |
sdkmanager --install "platforms;android-31" | |
sdkmanager --install "platforms;android-33" | |
sdkmanager --install "platforms;android-34" | |
sdkmanager --install "ndk-bundle" | |
- name: Setup Java JDK 11 | |
uses: actions/[email protected] | |
if: runner.os == 'Windows' | |
with: | |
java-version: 11 | |
distribution: "temurin" | |
# Install CMake | |
- uses: lukka/get-cmake@latest | |
if: runner.os != 'Linux' | |
- name: Build SDL2 | |
if: runner.os == 'Linux' | |
uses: Beyley/run-as-1804@239b211a2ca687388b6251d6dab22cb90ac0391d | |
with: | |
command: | | |
# We need to adjust APT sources for multiarch. Use the ones corresponding to | |
# Ubuntu 18.04 with appropriate `arch` values. ports.ubuntu.com is required | |
# for armhf and arm64. | |
tee /etc/apt/sources.list << EOF | |
deb [arch=amd64] http://archive.ubuntu.com/ubuntu bionic main multiverse restricted universe | |
deb [arch=amd64] http://archive.ubuntu.com/ubuntu bionic-backports main multiverse restricted universe | |
deb [arch=amd64] http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe | |
deb [arch=amd64] http://archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe | |
deb [arch=arm64,armhf] http://ports.ubuntu.com bionic main multiverse restricted universe | |
deb [arch=arm64,armhf] http://ports.ubuntu.com bionic-backports main multiverse restricted universe | |
deb [arch=arm64,armhf] http://ports.ubuntu.com bionic-security main multiverse restricted universe | |
deb [arch=arm64,armhf] http://ports.ubuntu.com bionic-updates main multiverse restricted universe | |
deb [arch=amd64] http://security.ubuntu.com/ubuntu bionic main multiverse restricted universe | |
deb [arch=amd64] http://security.ubuntu.com/ubuntu bionic-backports main multiverse restricted universe | |
deb [arch=amd64] http://security.ubuntu.com/ubuntu bionic-security main multiverse restricted universe | |
deb [arch=amd64] http://security.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe | |
EOF | |
dpkg --add-architecture arm64 | |
dpkg --add-architecture armhf | |
apt update | |
apt install -y gcc gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf | |
apt install -y g++ g++-aarch64-linux-gnu g++-arm-linux-gnueabihf | |
apt install -y automake build-essential curl git libtool pkg-config python3 wget | |
for arch in amd64 arm64 armhf; do | |
apt install -y libasound2-dev:$arch libpulse-dev:$arch libaudio-dev:$arch | |
apt install -y libsndio-dev:$arch libsamplerate0-dev:$arch libx11-dev:$arch libxext-dev:$arch | |
apt install -y libxrandr-dev:$arch libxcursor-dev:$arch libxfixes-dev:$arch libxi-dev:$arch | |
apt install -y libxss-dev:$arch libwayland-dev:$arch libxkbcommon-dev:$arch libdrm-dev:$arch | |
apt install -y libgbm-dev:$arch libgl1-mesa-dev:$arch libgles2-mesa-dev:$arch libegl1-mesa-dev:$arch | |
apt install -y libdbus-1-dev:$arch libibus-1.0-dev:$arch libudev-dev:$arch | |
done | |
# This package isn't multiarch-compatible in 22.04, so we prioritize amd64 for this. | |
apt install -y libjack-dev | |
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh | |
chmod +x ./dotnet-install.sh | |
./dotnet-install.sh --version 7.0.203 | |
./dotnet-install.sh --version 6.0.408 | |
export DOTNET_ROOT=$HOME/.dotnet | |
export PATH=$PATH:$HOME/.dotnet:$HOME/.dotnet/tools | |
# export the pushable token to the env of the docker container | |
export PUSHABLE_GITHUB_TOKEN=${{ secrets.PUSHABLE_GITHUB_TOKEN }} | |
# mark workspace as safe | |
git config --global --add safe.directory /github/workspace | |
git config --global --add safe.directory /github/workspace/build/submodules/SDL | |
${{ matrix.env.nuke_invoke }} SDL2 | |
env: | |
PUSHABLE_GITHUB_TOKEN: ${{ secrets.PUSHABLE_GITHUB_TOKEN }} | |
- name: Build SDL2 | |
if: runner.os != 'Linux' | |
run: ${{ matrix.env.nuke_invoke }} SDL2 ${{ runner.os == 'Windows' && format('{0} {1}', '--native true --android-sdk-override', env.ANDROID_HOME) || '' }} | |
env: | |
PUSHABLE_GITHUB_TOKEN: ${{ secrets.PUSHABLE_GITHUB_TOKEN }} | |