|
| 1 | +name: LWJGL Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +env: |
| 9 | + AWS_DEFAULT_REGION: us-east-1 |
| 10 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 11 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 12 | + S3_PARAMS: --cache-control "public,must-revalidate,proxy-revalidate,max-age=0" |
| 13 | + CMAKE_BUILD_PARALLEL_LEVEL: 4 |
| 14 | + SPVC_PARAMS: -DSPIRV_CROSS_STATIC=OFF -DSPIRV_CROSS_SHARED=ON -DSPIRV_CROSS_CLI=OFF -DSPIRV_CROSS_ENABLE_TESTS=OFF -DSPIRV_CROSS_SKIP_INSTALL=ON -DSPIRV_CROSS_WERROR=ON -DSPIRV_CROSS_FORCE_PIC=ON |
| 15 | + |
| 16 | +jobs: |
| 17 | + linux: |
| 18 | + name: Linux |
| 19 | + runs-on: ubuntu-latest |
| 20 | + container: |
| 21 | + image: centos:7 |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + ARCH: [x64] |
| 26 | + include: |
| 27 | + - ARCH: x64 |
| 28 | + defaults: |
| 29 | + run: |
| 30 | + shell: bash |
| 31 | + steps: |
| 32 | + - name: Upgrade git |
| 33 | + run: | |
| 34 | + sed -i \ |
| 35 | + -e 's/^mirrorlist/#mirrorlist/' \ |
| 36 | + -e 's/^#baseurl/baseurl/' \ |
| 37 | + -e 's/mirror\.centos\.org/vault.centos.org/' \ |
| 38 | + /etc/yum.repos.d/*.repo |
| 39 | + yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm |
| 40 | + yum -y install git |
| 41 | + - name: Clone repository |
| 42 | + run: git clone --depth 3 https://github.com/${{ github.repository }}.git . |
| 43 | + - name: Configure yum |
| 44 | + run: | |
| 45 | + yum -y install epel-release |
| 46 | + yum -y update |
| 47 | + - name: Install build dependencies |
| 48 | + run: | |
| 49 | + yum -y install centos-release-scl |
| 50 | + sed -i \ |
| 51 | + -e 's/^mirrorlist/#mirrorlist/' \ |
| 52 | + -e 's/^#baseurl/baseurl/' \ |
| 53 | + -e 's/^# baseurl/baseurl/' \ |
| 54 | + -e 's/mirror\.centos\.org/vault.centos.org/' \ |
| 55 | + /etc/yum.repos.d/CentOS-SCLo-scl*.repo |
| 56 | + yum -y install devtoolset-11-gcc-c++ |
| 57 | + yum -y install cmake3 awscli |
| 58 | + - name: Configure build |
| 59 | + run: | |
| 60 | + source scl_source enable devtoolset-11 || true |
| 61 | + cmake3 -B build $SPVC_PARAMS -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" |
| 62 | + - name: Build |
| 63 | + run: | |
| 64 | + source scl_source enable devtoolset-11 || true |
| 65 | + cmake3 --build build --parallel |
| 66 | + strip build/libspirv-cross-c-shared.so |
| 67 | + - name: Upload artifact |
| 68 | + run: aws s3 cp build/libspirv-cross-c-shared.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/libspirv-cross.so ${{env.S3_PARAMS}} |
| 69 | + - name: Upload git revision |
| 70 | + run: | |
| 71 | + git config --global --add safe.directory $PWD |
| 72 | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libspirv-cross.so.git |
| 73 | + aws s3 cp libspirv-cross.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} |
| 74 | +
|
| 75 | + linux-cross: |
| 76 | + name: Linux Cross |
| 77 | + runs-on: ubuntu-22.04 |
| 78 | + strategy: |
| 79 | + fail-fast: false |
| 80 | + matrix: |
| 81 | + ARCH: [arm32, arm64, mips64, ppc64le, riscv64] |
| 82 | + include: |
| 83 | + # ----- |
| 84 | + - ARCH: arm32 |
| 85 | + CROSS_ARCH: armhf |
| 86 | + TRIPLET: arm-linux-gnueabihf |
| 87 | + # ----- |
| 88 | + - ARCH: arm64 |
| 89 | + CROSS_ARCH: arm64 |
| 90 | + TRIPLET: aarch64-linux-gnu |
| 91 | + # ----- |
| 92 | + - ARCH: mips64 |
| 93 | + CROSS_ARCH: mips64el |
| 94 | + TRIPLET: mips64el-linux-gnuabi64 |
| 95 | + # ---- |
| 96 | + - ARCH: ppc64le |
| 97 | + CROSS_ARCH: ppc64el |
| 98 | + TRIPLET: powerpc64le-linux-gnu |
| 99 | + # ----- |
| 100 | + - ARCH: riscv64 |
| 101 | + CROSS_ARCH: riscv64 |
| 102 | + TRIPLET: riscv64-linux-gnu |
| 103 | + defaults: |
| 104 | + run: |
| 105 | + shell: bash |
| 106 | + steps: |
| 107 | + - uses: actions/checkout@v4 |
| 108 | + with: |
| 109 | + fetch-depth: 3 |
| 110 | + - name: Install dependencies |
| 111 | + run: | |
| 112 | + DEBIAN_FRONTEND=noninteractive sudo apt-get -yq update |
| 113 | + DEBIAN_FRONTEND=noninteractive sudo apt-get -yq install awscli cmake gcc-${{matrix.TRIPLET}} g++-${{matrix.TRIPLET}} libc6-dev-${{matrix.CROSS_ARCH}}-cross |
| 114 | + - name: Configure build |
| 115 | + run: CC=${{matrix.TRIPLET}}-gcc CXX=${{matrix.TRIPLET}}-g++ cmake -B build $SPVC_PARAMS -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" |
| 116 | + - name: Build |
| 117 | + run: | |
| 118 | + cmake --build build --parallel |
| 119 | + ${{matrix.TRIPLET}}-strip build/libspirv-cross-c-shared.so |
| 120 | + - name: Upload artifact |
| 121 | + run: aws s3 cp build/libspirv-cross-c-shared.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/libspirv-cross.so ${{env.S3_PARAMS}} |
| 122 | + - name: Upload git revision |
| 123 | + run: | |
| 124 | + git config --global --add safe.directory $(pwd) |
| 125 | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libspirv-cross.so.git |
| 126 | + aws s3 cp libspirv-cross.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} |
| 127 | +
|
| 128 | +# linux-cross: |
| 129 | +# name: Linux Cross |
| 130 | +# runs-on: ubuntu-latest |
| 131 | +# container: |
| 132 | +# image: ${{matrix.CONTAINER}} |
| 133 | +# strategy: |
| 134 | +# fail-fast: false |
| 135 | +# matrix: |
| 136 | +# ARCH: [arm32, arm64, mips64, ppc64le, riscv64] |
| 137 | +# include: |
| 138 | +# # ----- |
| 139 | +# - ARCH: arm32 |
| 140 | +# CROSS_ARCH: armhf |
| 141 | +# CONTAINER: ubuntu:18.04 |
| 142 | +# TRIPLET: arm-linux-gnueabihf |
| 143 | +# # ----- |
| 144 | +# - ARCH: arm64 |
| 145 | +# CROSS_ARCH: arm64 |
| 146 | +# CONTAINER: ubuntu:18.04 |
| 147 | +# TRIPLET: aarch64-linux-gnu |
| 148 | +# # ----- |
| 149 | +# - ARCH: mips64 |
| 150 | +# CROSS_ARCH: mips64el |
| 151 | +# CONTAINER: ubuntu:18.04 |
| 152 | +# TRIPLET: mips64el-linux-gnuabi64 |
| 153 | +# # ---- |
| 154 | +# - ARCH: ppc64le |
| 155 | +# CROSS_ARCH: ppc64el |
| 156 | +# CONTAINER: ubuntu:18.04 |
| 157 | +# TRIPLET: powerpc64le-linux-gnu |
| 158 | +# # ----- |
| 159 | +# - ARCH: riscv64 |
| 160 | +# CROSS_ARCH: riscv64 |
| 161 | +# CONTAINER: ubuntu:18.04 |
| 162 | +# TRIPLET: riscv64-linux-gnu |
| 163 | +# defaults: |
| 164 | +# run: |
| 165 | +# shell: bash |
| 166 | +# steps: |
| 167 | +# - name: Upgrade git |
| 168 | +# run: | |
| 169 | +# apt-get -y update |
| 170 | +# apt-get -y install software-properties-common wget |
| 171 | +# apt-get -y install --reinstall ca-certificates |
| 172 | +# apt-get -y update |
| 173 | +# apt-get -y upgrade |
| 174 | +# wget https://apt.kitware.com/keys/kitware-archive-latest.asc |
| 175 | +# apt-key add kitware-archive-latest.asc |
| 176 | +# add-apt-repository -y 'deb https://apt.kitware.com/ubuntu/ bionic main' |
| 177 | +# add-apt-repository -y ppa:git-core/ppa |
| 178 | +# apt-get -y update |
| 179 | +# DEBIAN_FRONTEND=noninteractive apt-get -yq install awscli git |
| 180 | +# - uses: actions/checkout@v3 |
| 181 | +# with: |
| 182 | +# fetch-depth: 3 |
| 183 | +# - name: Install dependencies |
| 184 | +# run: DEBIAN_FRONTEND=noninteractive apt-get -yq install cmake gcc-${{matrix.TRIPLET}} g++-${{matrix.TRIPLET}} libc6-dev-${{matrix.CROSS_ARCH}}-cross |
| 185 | +# - name: Configure build |
| 186 | +# run: CC=${{matrix.TRIPLET}}-gcc CXX=${{matrix.TRIPLET}}-g++ cmake -B build $SPVC_PARAMS -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" |
| 187 | +# - name: Build |
| 188 | +# run: | |
| 189 | +# cmake --build build --parallel |
| 190 | +# ${{matrix.TRIPLET}}-strip build/libspirv-cross-c-shared.so |
| 191 | +# - name: Upload artifact |
| 192 | +# run: aws s3 cp build/libspirv-cross-c-shared.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/libspirv-cross.so ${{env.S3_PARAMS}} |
| 193 | +# - name: Upload git revision |
| 194 | +# run: | |
| 195 | +# git config --global --add safe.directory $(pwd) |
| 196 | +# git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libspirv-cross.so.git |
| 197 | +# aws s3 cp libspirv-cross.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} |
| 198 | + |
| 199 | + freebsd-cross: |
| 200 | + name: FreeBSD Cross |
| 201 | + runs-on: ubuntu-latest |
| 202 | + strategy: |
| 203 | + fail-fast: false |
| 204 | + steps: |
| 205 | + - uses: actions/checkout@v4 |
| 206 | + with: |
| 207 | + fetch-depth: 3 |
| 208 | + - name: Build |
| 209 | + uses: cross-platform-actions/action@v0.27.0 |
| 210 | + with: |
| 211 | + operating_system: freebsd |
| 212 | + architecture: x86-64 |
| 213 | + version: '13.4' |
| 214 | + memory: 4G |
| 215 | + shell: bash |
| 216 | + environment_variables: SPVC_PARAMS |
| 217 | + run: | |
| 218 | + sudo pkg install -y git cmake gmake |
| 219 | + cmake -B build $SPVC_PARAMS -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" |
| 220 | + cmake --build build --parallel |
| 221 | + strip build/libspirv-cross-c-shared.so |
| 222 | + - name: Upload artifact |
| 223 | + run: aws s3 cp build/libspirv-cross-c-shared.so s3://lwjgl-build/nightly/freebsd/x64/libspirv-cross.so ${{env.S3_PARAMS}} |
| 224 | + - name: Upload git revision |
| 225 | + run: | |
| 226 | + git config --global --add safe.directory $PWD |
| 227 | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libspirv-cross.so.git |
| 228 | + aws s3 cp libspirv-cross.so.git s3://lwjgl-build/nightly/freebsd/x64/ ${{env.S3_PARAMS}} |
| 229 | +
|
| 230 | + macos: |
| 231 | + name: macOS |
| 232 | + runs-on: macos-latest |
| 233 | + strategy: |
| 234 | + fail-fast: false |
| 235 | + matrix: |
| 236 | + ARCH: [x64, arm64] |
| 237 | + include: |
| 238 | + - ARCH: x64 |
| 239 | + CMAKE_PARAMS: -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DCMAKE_OSX_ARCHITECTURES=x86_64 |
| 240 | + - ARCH: arm64 |
| 241 | + CMAKE_PARAMS: -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_OSX_ARCHITECTURES=arm64 |
| 242 | + steps: |
| 243 | + - uses: actions/checkout@v4 |
| 244 | + with: |
| 245 | + fetch-depth: 3 |
| 246 | + - name: Configure build |
| 247 | + run: cmake -B build $SPVC_PARAMS -DCMAKE_BUILD_TYPE=Release ${{matrix.CMAKE_PARAMS}} |
| 248 | + - name: Build |
| 249 | + run: | |
| 250 | + cmake --build build --parallel |
| 251 | + strip -u -r build/libspirv-cross-c-shared.dylib |
| 252 | + - name: Upload artifact |
| 253 | + run: aws s3 cp build/libspirv-cross-c-shared.dylib s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/libspirv-cross.dylib ${{env.S3_PARAMS}} |
| 254 | + - name: Upload git revision |
| 255 | + run: | |
| 256 | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libspirv-cross.dylib.git |
| 257 | + aws s3 cp libspirv-cross.dylib.git s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} |
| 258 | +
|
| 259 | + windows: |
| 260 | + name: Windows |
| 261 | + runs-on: windows-latest |
| 262 | + strategy: |
| 263 | + fail-fast: false |
| 264 | + matrix: |
| 265 | + ARCH: [x86, x64, arm64] |
| 266 | + include: |
| 267 | + - ARCH: x86 |
| 268 | + PLATFORM: Win32 |
| 269 | + - ARCH: x64 |
| 270 | + PLATFORM: x64 |
| 271 | + - ARCH: arm64 |
| 272 | + PLATFORM: ARM64 |
| 273 | + defaults: |
| 274 | + run: |
| 275 | + shell: cmd |
| 276 | + steps: |
| 277 | + - uses: actions/checkout@v4 |
| 278 | + with: |
| 279 | + fetch-depth: 3 |
| 280 | + - name: Configure build |
| 281 | + #-T ClangCL |
| 282 | + run: cmake -B build -G "Visual Studio 17 2022" -A ${{matrix.PLATFORM}} %SPVC_PARAMS% |
| 283 | + - name: Build |
| 284 | + run: cmake --build build --parallel --config Release |
| 285 | + - name: Upload artifact |
| 286 | + run: aws s3 cp build\Release\spirv-cross-c-shared.dll s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/spirv-cross.dll ${{env.S3_PARAMS}} |
| 287 | + - name: Upload git revision |
| 288 | + run: | |
| 289 | + git log --first-parent --pretty=format:%%H HEAD~2..HEAD~1 > spirv-cross.dll.git |
| 290 | + aws s3 cp spirv-cross.dll.git s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} |
0 commit comments