@@ -15,16 +15,16 @@ jobs:
15
15
fail-fast : false
16
16
matrix :
17
17
platform :
18
- - { name: win-x64, os: windows-latest, flags: -A x64 }
19
- - { name: win-x86, os: windows-latest, flags: -A Win32 }
20
- - { name: win-arm64, os: windows-latest, flags: -A ARM64 }
21
- - { name: linux-x64, os: ubuntu-20.04, flags: -GNinja, target_apt_arch: ":amd64" }
22
- - { name: linux-x86, os: ubuntu-20.04, flags: -GNinja, cmake_configure_env: CFLAGS=-m32 CXXFLAGS=-m32, target_apt_arch: ":i386" }
18
+ - { name: win-x64, os: windows-latest, flags: -A x64 }
19
+ - { name: win-x86, os: windows-latest, flags: -A Win32 }
20
+ - { name: win-arm64, os: windows-latest, flags: -A ARM64 }
21
+ - { name: linux-x64, os: ubuntu-20.04, flags: -GNinja, target_apt_arch: ":amd64"}
22
+ - { name: linux-x86, os: ubuntu-20.04, flags: -GNinja, target_apt_arch: ":i386" }
23
23
- { name: linux-arm64, os: ubuntu-20.04, container: arm64v8/ubuntu }
24
24
- { name: linux-arm, os: ubuntu-20.04, container: arm32v7/ubuntu }
25
- - { name: osx-x64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.14" }
25
+ - { name: osx-x64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.14" }
26
26
# NOTE: macOS 11.0 is the first released supported by Apple Silicon.
27
- - { name: osx-arm64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" }
27
+ - { name: osx-arm64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" }
28
28
steps :
29
29
- uses : actions/checkout@v4
30
30
with :
44
44
uses : addnab/docker-run-action@v3
45
45
with :
46
46
image : ${{ matrix.platform.container }}
47
- options : -v ${{ github.workspace }}:/workspace
47
+ options : -v ${{ github.workspace }}:/workspace -e NAME=${{ matrix.platform.name }} -e BUILD_TYPE=${{ env.BUILD_TYPE }}
48
48
run : |
49
49
apt update -y -qq
50
50
apt install -y \
@@ -86,22 +86,28 @@ jobs:
86
86
cmake --build build/ --config Release
87
87
cmake --install build/ --prefix install_output --config Release
88
88
89
- mkdir -p SDL3-CS/native/${{ matrix.platform.name }}
90
- cp install_output/lib/libSDL3.so SDL3-CS/native/${{ matrix.platform.name }} /libSDL3.so
89
+ mkdir -p SDL3-CS/native/$NAME
90
+ cp install_output/lib/libSDL3.so SDL3-CS/native/$NAME /libSDL3.so
91
91
92
92
- name : Build
93
93
if : ${{ !contains(matrix.platform.container, 'arm') }}
94
94
shell : bash
95
+ env :
96
+ NAME : ${{ matrix.platform.name }}
97
+ TARGET_APT_ARCH : ${{ matrix.platform.target_apt_arch }}
98
+ RUNNER_OS : ${{ runner.os }}
99
+ FLAGS : ${{ matrix.platform.flags }}
100
+
95
101
run : |
96
- if [[ ${{ runner.os }} == 'Linux' ]]; then
102
+ if [[ $RUNNER_OS == 'Linux' ]]; then
97
103
# Setup Linux dependencies
98
- if [[ ${{ matrix.platform.target_apt_arch }} == :i386 ]]; then
104
+ if [[ $TARGET_APT_ARCH == :i386 ]]; then
99
105
sudo dpkg --add-architecture i386
100
106
fi
101
107
102
108
sudo apt-get update -y -qq
103
109
104
- if [[ ${{ matrix.platform.target_apt_arch }} == :i386 ]]; then
110
+ if [[ $TARGET_APT_ARCH == :i386 ]]; then
105
111
# Workaround GitHub's ubuntu-20.04 image issue <https://github.com/actions/virtual-environments/issues/4589>
106
112
sudo apt-get install -y --allow-downgrades libpcre2-8-0=10.34-7
107
113
fi
@@ -113,63 +119,59 @@ jobs:
113
119
ninja-build \
114
120
wayland-scanner++ \
115
121
wayland-protocols \
116
- pkg-config${{ matrix.platform.target_apt_arch }} \
117
- libasound2-dev${{ matrix.platform.target_apt_arch }} \
118
- libdbus-1-dev${{ matrix.platform.target_apt_arch }} \
119
- libegl1-mesa-dev${{ matrix.platform.target_apt_arch }} \
120
- libgl1-mesa-dev${{ matrix.platform.target_apt_arch }} \
121
- libgles2-mesa-dev${{ matrix.platform.target_apt_arch }} \
122
- libglu1-mesa-dev${{ matrix.platform.target_apt_arch }} \
123
- libibus-1.0-dev${{ matrix.platform.target_apt_arch }} \
124
- libpulse-dev${{ matrix.platform.target_apt_arch }} \
125
- libsndio-dev${{ matrix.platform.target_apt_arch }} \
126
- libudev-dev${{ matrix.platform.target_apt_arch }} \
127
- libwayland-dev${{ matrix.platform.target_apt_arch }} \
128
- libx11-dev${{ matrix.platform.target_apt_arch }} \
129
- libxcursor-dev${{ matrix.platform.target_apt_arch }} \
130
- libxext-dev${{ matrix.platform.target_apt_arch }} \
131
- libxi-dev${{ matrix.platform.target_apt_arch }} \
132
- libxinerama-dev${{ matrix.platform.target_apt_arch }} \
133
- libxkbcommon-dev${{ matrix.platform.target_apt_arch }} \
134
- libxrandr-dev${{ matrix.platform.target_apt_arch }} \
135
- libxss-dev${{ matrix.platform.target_apt_arch }} \
136
- libxt-dev${{ matrix.platform.target_apt_arch }} \
137
- libxv-dev${{ matrix.platform.target_apt_arch }} \
138
- libxxf86vm-dev${{ matrix.platform.target_apt_arch }} \
139
- libdrm-dev${{ matrix.platform.target_apt_arch }} \
140
- libgbm-dev${{ matrix.platform.target_apt_arch }} \
141
- libpulse-dev${{ matrix.platform.target_apt_arch }}
122
+ pkg-config$TARGET_APT_ARCH \
123
+ libasound2-dev$TARGET_APT_ARCH \
124
+ libdbus-1-dev$TARGET_APT_ARCH \
125
+ libegl1-mesa-dev$TARGET_APT_ARCH \
126
+ libgl1-mesa-dev$TARGET_APT_ARCH \
127
+ libgles2-mesa-dev$TARGET_APT_ARCH \
128
+ libglu1-mesa-dev$TARGET_APT_ARCH \
129
+ libibus-1.0-dev$TARGET_APT_ARCH \
130
+ libpulse-dev$TARGET_APT_ARCH \
131
+ libsndio-dev$TARGET_APT_ARCH \
132
+ libudev-dev$TARGET_APT_ARCH \
133
+ libwayland-dev$TARGET_APT_ARCH \
134
+ libx11-dev$TARGET_APT_ARCH \
135
+ libxcursor-dev$TARGET_APT_ARCH \
136
+ libxext-dev$TARGET_APT_ARCH \
137
+ libxi-dev$TARGET_APT_ARCH \
138
+ libxinerama-dev$TARGET_APT_ARCH \
139
+ libxkbcommon-dev$TARGET_APT_ARCH \
140
+ libxrandr-dev$TARGET_APT_ARCH \
141
+ libxss-dev$TARGET_APT_ARCH \
142
+ libxt-dev$TARGET_APT_ARCH \
143
+ libxv-dev$TARGET_APT_ARCH \
144
+ libxxf86vm-dev$TARGET_APT_ARCH \
145
+ libdrm-dev$TARGET_APT_ARCH \
146
+ libgbm-dev$TARGET_APT_ARCH \
147
+ libpulse-dev$TARGET_APT_ARCH
142
148
fi
143
149
144
150
# Configure CMake
145
- ${{ matrix.platform.cmake_configure_env }} cmake -B build ${{ matrix.platform.flags }} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON
151
+ cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON -E
146
152
147
153
# Build
148
154
cmake --build build/ --config Release
149
155
150
- if [[ ${{ runner.os }} == 'Windows' ]]; then
156
+ if [[ $RUNNER_OS == 'Windows' ]]; then
151
157
# Install (Windows)
152
158
cmake --install build/ --prefix install_output --config Release
153
-
154
- # Prepare release directory (Windows)
155
- mkdir -Force SDL3-CS/native/${{ matrix.platform.name }}
156
159
else
157
160
# Install
158
161
sudo cmake --install build/ --prefix install_output --config Release
159
-
160
- # Prepare release directory
161
- mkdir -p SDL3-CS/native/${{ matrix.platform.name }}
162
162
fi
163
163
164
- if [[ ${{ runner.os }} == 'Windows' ]]; then
164
+ mkdir -p SDL3-CS/native/$NAME
165
+
166
+ if [[ $RUNNER_OS == 'Windows' ]]; then
165
167
# Prepare release (Windows)
166
- cp install_output/bin/SDL3.dll SDL3-CS/native/${{ matrix.platform.name }} /SDL3.dll
167
- elif [[ ${{ runner.os }} == 'Linux' ]]; then
168
+ cp install_output/bin/SDL3.dll SDL3-CS/native/$NAME /SDL3.dll
169
+ elif [[ $RUNNER_OS == 'Linux' ]]; then
168
170
# Prepare release (Linux)
169
- cp install_output/lib/libSDL3.so SDL3-CS/native/${{ matrix.platform.name }} /libSDL3.so
170
- elif [[ ${{ runner.os }} == 'macOS' ]]; then
171
+ cp install_output/lib/libSDL3.so SDL3-CS/native/$NAME /libSDL3.so
172
+ elif [[ $RUNNER_OS == 'macOS' ]]; then
171
173
# Prepare release (macOS)
172
- cp install_output/lib/libSDL3.dylib SDL3-CS/native/${{ matrix.platform.name }} /libSDL3.dylib
174
+ cp install_output/lib/libSDL3.dylib SDL3-CS/native/$NAME /libSDL3.dylib
173
175
fi
174
176
175
177
- name : Create pull request
0 commit comments