|
| 1 | +# IMPORTANT: after HEAD is updated, the "LWJGL" tag must be recreated! |
| 2 | +name: LWJGL Build |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - master |
| 9 | + |
| 10 | +env: |
| 11 | + AWS_DEFAULT_REGION: us-east-1 |
| 12 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 13 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 14 | + S3_PARAMS: --cache-control "public,must-revalidate,proxy-revalidate,max-age=0" |
| 15 | + FREETYPE_PARAMS: --wrap-mode=default --force-fallback-for=harfbuzz,libpng,zlib -Dbrotli=disabled -Dbzip2=disabled -Dharfbuzz=enabled -Dpng=enabled -Dzlib=system -Dtests=disabled -Dbuildtype=release -Dfreetype2:zlib=disabled -Dfreetype2:png=disabled -Dharfbuzz:experimental_api=true -Db_lto=true -Db_ndebug=true |
| 16 | + |
| 17 | +jobs: |
| 18 | + linux: |
| 19 | + name: Linux |
| 20 | + runs-on: ubuntu-latest |
| 21 | + container: |
| 22 | + image: centos:7 |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + ARCH: [x64] |
| 27 | + include: |
| 28 | + - ARCH: x64 |
| 29 | + defaults: |
| 30 | + run: |
| 31 | + shell: bash |
| 32 | + steps: |
| 33 | + - name: Upgrade git |
| 34 | + run: | |
| 35 | + sed -i \ |
| 36 | + -e 's/^mirrorlist/#mirrorlist/' \ |
| 37 | + -e 's/^#baseurl/baseurl/' \ |
| 38 | + -e 's/mirror\.centos\.org/vault.centos.org/' \ |
| 39 | + /etc/yum.repos.d/*.repo |
| 40 | + yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm |
| 41 | + yum -y install git |
| 42 | + - uses: actions/checkout@v3 |
| 43 | + with: |
| 44 | + fetch-depth: 3 |
| 45 | + - name: Configure yum |
| 46 | + run: | |
| 47 | + yum -y install epel-release |
| 48 | + yum -y update |
| 49 | + - name: Install build dependencies |
| 50 | + run: | |
| 51 | + yum -y install centos-release-scl |
| 52 | + sed -i \ |
| 53 | + -e 's/^mirrorlist/#mirrorlist/' \ |
| 54 | + -e 's/^#baseurl/baseurl/' \ |
| 55 | + -e 's/^# baseurl/baseurl/' \ |
| 56 | + -e 's/mirror\.centos\.org/vault.centos.org/' \ |
| 57 | + /etc/yum.repos.d/CentOS-SCLo-scl*.repo |
| 58 | + yum -y install devtoolset-11-gcc-c++ |
| 59 | + yum -y install python3 awscli libpng-dev |
| 60 | + - name: Install HarfBuzz dependencies |
| 61 | + run: | |
| 62 | + yum -y install ninja-build |
| 63 | + pip3 install meson |
| 64 | + - name: Configure build |
| 65 | + run: | |
| 66 | + source scl_source enable devtoolset-11 || true |
| 67 | + meson setup build $FREETYPE_PARAMS |
| 68 | + - name: Build |
| 69 | + run: | |
| 70 | + source scl_source enable devtoolset-11 || true |
| 71 | + meson compile --verbose -C build |
| 72 | + strip build/libfreetype.so |
| 73 | + - name: Upload artifact |
| 74 | + run: aws s3 cp build/libfreetype.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} |
| 75 | + - name: Upload git revision |
| 76 | + run: | |
| 77 | + git config --global --add safe.directory $PWD |
| 78 | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libfreetype.so.git |
| 79 | + aws s3 cp libfreetype.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} |
| 80 | +
|
| 81 | + linux-cross: |
| 82 | + name: Linux Cross |
| 83 | + runs-on: ubuntu-22.04 |
| 84 | + strategy: |
| 85 | + fail-fast: false |
| 86 | + matrix: |
| 87 | + ARCH: [arm32, arm64, ppc64le, riscv64] |
| 88 | + include: |
| 89 | + # ----- |
| 90 | + - ARCH: arm32 |
| 91 | + CROSS_ARCH: armhf |
| 92 | + TRIPLET: arm-linux-gnueabihf |
| 93 | + # ----- |
| 94 | + - ARCH: arm64 |
| 95 | + CROSS_ARCH: arm64 |
| 96 | + TRIPLET: aarch64-linux-gnu |
| 97 | + # ----- |
| 98 | + - ARCH: ppc64le |
| 99 | + CROSS_ARCH: ppc64el |
| 100 | + TRIPLET: powerpc64le-linux-gnu |
| 101 | + # ----- |
| 102 | + - ARCH: riscv64 |
| 103 | + CROSS_ARCH: riscv64 |
| 104 | + TRIPLET: riscv64-linux-gnu |
| 105 | + env: |
| 106 | + LWJGL_ARCH: ${{matrix.ARCH}} |
| 107 | + defaults: |
| 108 | + run: |
| 109 | + shell: bash |
| 110 | + steps: |
| 111 | + - uses: actions/checkout@v4 |
| 112 | + with: |
| 113 | + fetch-depth: 3 |
| 114 | + - name: Install dependencies |
| 115 | + run: | |
| 116 | + DEBIAN_FRONTEND=noninteractive sudo apt-get -yq update |
| 117 | + DEBIAN_FRONTEND=noninteractive sudo apt-get -yq install awscli ninja-build python3-pip gcc-${{matrix.TRIPLET}} g++-${{matrix.TRIPLET}} libc6-dev-${{matrix.CROSS_ARCH}}-cross |
| 118 | + - name: Install meson |
| 119 | + run: pip3 install meson |
| 120 | +# - name: Prepare cross-compilation for ${{matrix.CROSS_ARCH}} |
| 121 | +# run: | |
| 122 | +# sudo sed -i 's/deb mirror/deb [arch=amd64,i386] mirror/' /etc/apt/sources.list |
| 123 | +# sudo grep "mirror+file" /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/ports.list |
| 124 | +# sudo sed -i 's/amd64,i386/${{matrix.CROSS_ARCH}}/' /etc/apt/sources.list.d/ports.list |
| 125 | +# sudo sed -i 's#mirror+file:/etc/apt/apt-mirrors.txt#http://ports.ubuntu.com/ubuntu-ports/#' /etc/apt/sources.list.d/ports.list |
| 126 | +# sudo dpkg --add-architecture ${{matrix.CROSS_ARCH}} |
| 127 | +# sudo apt-get update || true |
| 128 | + - name: Configure build |
| 129 | + run: meson setup build $FREETYPE_PARAMS --cross-file lwjgl_linux_${{matrix.ARCH}}.cross |
| 130 | + - name: Build |
| 131 | + run: | |
| 132 | + meson compile --verbose -C build |
| 133 | + ${{matrix.TRIPLET}}-strip build/libfreetype.so |
| 134 | + - name: Upload artifact |
| 135 | + run: aws s3 cp build/libfreetype.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} |
| 136 | + - name: Upload git revision |
| 137 | + run: | |
| 138 | + git config --global --add safe.directory $(pwd) |
| 139 | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libfreetype.so.git |
| 140 | + aws s3 cp libfreetype.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} |
| 141 | +
|
| 142 | + freebsd-cross: |
| 143 | + name: FreeBSD Cross |
| 144 | + runs-on: ubuntu-latest |
| 145 | + strategy: |
| 146 | + fail-fast: false |
| 147 | + steps: |
| 148 | + - uses: actions/checkout@v4 |
| 149 | + with: |
| 150 | + fetch-depth: 3 |
| 151 | + - name: Build |
| 152 | + uses: cross-platform-actions/[email protected] |
| 153 | + with: |
| 154 | + operating_system: freebsd |
| 155 | + architecture: x86-64 |
| 156 | + version: '13.4' |
| 157 | + memory: 4G |
| 158 | + shell: bash |
| 159 | + environment_variables: FREETYPE_PARAMS |
| 160 | + run: | |
| 161 | + sudo pkg install -y git python3 png ninja |
| 162 | + python3 -m ensurepip --upgrade |
| 163 | + export PATH=$PATH:/home/runner/.local/bin |
| 164 | + pip3 install meson |
| 165 | + meson setup build $FREETYPE_PARAMS |
| 166 | + meson compile --verbose -C build |
| 167 | + strip build/libfreetype.so |
| 168 | + - name: Upload artifact # Symlinks are not copied out of the VM. These SOs are versioned. |
| 169 | + #run: aws s3 cp `find -E . -maxdepth 2 -regex './build/libfreetype.so(\.[0-9]+)*'` s3://lwjgl-build/nightly/freebsd/x64/libfreetype.so ${{env.S3_PARAMS}} |
| 170 | + run: aws s3 cp build/libfreetype.so s3://lwjgl-build/nightly/freebsd/x64/ ${{env.S3_PARAMS}} |
| 171 | + - name: Upload git revision |
| 172 | + run: | |
| 173 | + git config --global --add safe.directory $PWD |
| 174 | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libfreetype.so.git |
| 175 | + aws s3 cp libfreetype.so.git s3://lwjgl-build/nightly/freebsd/x64/ ${{env.S3_PARAMS}} |
| 176 | +
|
| 177 | + macos: |
| 178 | + name: macOS |
| 179 | + runs-on: macos-latest |
| 180 | + strategy: |
| 181 | + fail-fast: false |
| 182 | + matrix: |
| 183 | + ARCH: [x64, arm64] |
| 184 | + include: |
| 185 | + - ARCH: x64 |
| 186 | + MACOS: 10.11 |
| 187 | + MESON_PARAMS: --cross-file lwjgl_macos_x64.cross |
| 188 | + - ARCH: arm64 |
| 189 | + MACOS: 11.0 |
| 190 | + MESON_PARAMS: --cross-file lwjgl_macos_arm64.cross |
| 191 | + env: |
| 192 | + MACOSX_DEPLOYMENT_TARGET: 11.0 |
| 193 | + steps: |
| 194 | + - uses: actions/checkout@v4 |
| 195 | + with: |
| 196 | + fetch-depth: 3 |
| 197 | + - name: Install dependencies |
| 198 | + run: brew install meson |
| 199 | + - name: Configure build |
| 200 | + run: MACOSX_DEPLOYMENT_TARGET=${{matrix.MACOS}} meson setup build $FREETYPE_PARAMS -Dharfbuzz:coretext=enabled ${{matrix.MESON_PARAMS}} |
| 201 | + - name: Build |
| 202 | + run: | |
| 203 | + MACOSX_DEPLOYMENT_TARGET=${{matrix.MACOS}} meson compile --verbose -C build |
| 204 | + strip -u -r build/libfreetype.dylib |
| 205 | + - name: Upload artifact |
| 206 | + run: aws s3 cp build/libfreetype.dylib s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} |
| 207 | + - name: Upload git revision |
| 208 | + run: | |
| 209 | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libfreetype.dylib.git |
| 210 | + aws s3 cp libfreetype.dylib.git s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} |
| 211 | +
|
| 212 | + windows: |
| 213 | + name: Windows |
| 214 | + runs-on: windows-latest |
| 215 | + strategy: |
| 216 | + fail-fast: false |
| 217 | + matrix: |
| 218 | + ARCH: [x86, x64, arm64] |
| 219 | + include: |
| 220 | + - ARCH: x86 |
| 221 | + MSVC_ARCH: amd64_x86 |
| 222 | + PLATFORM: Win32 |
| 223 | + MESON_PARAMS: |
| 224 | + - ARCH: x64 |
| 225 | + MSVC_ARCH: amd64 |
| 226 | + PLATFORM: x64 |
| 227 | + MESON_PARAMS: |
| 228 | + - ARCH: arm64 |
| 229 | + MSVC_ARCH: amd64_arm64 |
| 230 | + PLATFORM: ARM64 |
| 231 | + MESON_PARAMS: --cross-file lwjgl_windows_arm64.cross |
| 232 | + defaults: |
| 233 | + run: |
| 234 | + shell: cmd |
| 235 | + steps: |
| 236 | + - uses: actions/checkout@v4 |
| 237 | + with: |
| 238 | + fetch-depth: 3 |
| 239 | + - uses: ilammy/msvc-dev-cmd@v1 |
| 240 | + with: |
| 241 | + arch: ${{matrix.MSVC_ARCH}} |
| 242 | + # Strawberry Perl is installed by default on the Windows runner, adding a bunch of horrible stuff to PATH. |
| 243 | + # Including a freetype build... which Meson picks up. Just nuke it here and everything will be fine. |
| 244 | + # See https://github.com/actions/runner-images/issues/5459 for details. We haven't encountered this before |
| 245 | + # because Meson uses .a for static MSVC libraries, instead of the usual .lib suffix. |
| 246 | + - name: Install dependencies |
| 247 | + run: | |
| 248 | + pip3 install meson==1.4.1 |
| 249 | + rmdir C:\Strawberry /s /q |
| 250 | + - name: Configure build |
| 251 | + run: meson setup build %FREETYPE_PARAMS% -Db_vscrt=mt -Dharfbuzz:gdi=enabled -Dharfbuzz:directwrite=enabled ${{matrix.MESON_PARAMS}} |
| 252 | + - name: Build |
| 253 | + run: meson compile --verbose -C build |
| 254 | + - name: Upload artifact |
| 255 | + run: aws s3 cp build\freetype-6.dll s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/freetype.dll ${{env.S3_PARAMS}} |
| 256 | + - name: Upload git revision |
| 257 | + run: | |
| 258 | + git log --first-parent --pretty=format:%%H HEAD~2..HEAD~1 > freetype.dll.git |
| 259 | + aws s3 cp freetype.dll.git s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/ ${{env.S3_PARAMS}} |
0 commit comments