Fix codepoint comparisions in *cmp* functions #4
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: Windows (i686/x86_64/armv7/aarch64) | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { sys: mingw32, target: i686, stdlib: msvcrt } | |
- { sys: mingw32, target: x86_64, stdlib: msvcrt } | |
- { sys: mingw32, target: armv7, stdlib: msvcrt } | |
- { sys: mingw32, target: aarch64, stdlib: ucrt } | |
name: ${{ matrix.sys }}-${{ matrix.target }} | |
env: | |
LLVM_MINGW_VERSION: 20240518 | |
SDL_VERSION: 2.30.7 | |
FLAC_VERSION: 1.4.3 | |
LIBOGG_VERSION: 1.3.5 | |
UTF8PROC_VERSION: 2.9.0 | |
TARGET: ${{ matrix.target }} | |
SYS: ${{ matrix.sys }} | |
STDLIB: ${{ matrix.stdlib }} | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
with: | |
path: schism | |
- name: 'Install unix2dos' | |
run: | | |
sudo apt-get install -y dos2unix | |
- name: 'Grab llvm-mingw' | |
run: | | |
curl -L "https://github.com/mstorsjo/llvm-mingw/releases/download/$LLVM_MINGW_VERSION/llvm-mingw-$LLVM_MINGW_VERSION-$STDLIB-ubuntu-20.04-x86_64.tar.xz" | tar xJvf - -C "$HOME" | |
mv "$HOME/llvm-mingw-$LLVM_MINGW_VERSION-$STDLIB-ubuntu-20.04-x86_64" "$HOME/llvm-mingw" | |
- name: 'Grab SDL2' | |
run: | | |
# Use GitHub as a fallback when SDL's website fails | |
(curl https://www.libsdl.org/release/SDL2-$SDL_VERSION.tar.gz || curl -L https://github.com/libsdl-org/SDL/releases/download/release-$SDL_VERSION/SDL2-$SDL_VERSION.tar.gz) | tar -xzvf - | |
- name: 'Build SDL2' | |
run: | | |
export PATH="$HOME/llvm-mingw/bin:$PATH" | |
cd SDL2-$SDL_VERSION | |
./configure --host="$TARGET-w64-$SYS" --prefix="$HOME/$TARGET" | |
make | |
make install | |
cd .. | |
- name: 'Download libflac and libogg sources' | |
run: | | |
(curl https://ftp.osuosl.org/pub/xiph/releases/flac/flac-$FLAC_VERSION.tar.xz || curl -L https://github.com/xiph/flac/releases/download/$FLAC_VERSION/flac-$FLAC_VERSION.tar.xz) | tar -xJvf - | |
(curl https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-$LIBOGG_VERSION.tar.gz || curl -L https://github.com/xiph/ogg/releases/download/v$LIBOGG_VERSION/libogg-$LIBOGG_VERSION.tar.gz) | tar -xzvf - | |
- name: 'Build libflac' | |
run: | | |
export PATH="$HOME/llvm-mingw/bin:$PATH" | |
cd libogg-$LIBOGG_VERSION | |
mkdir build | |
cd build | |
../configure --host="$TARGET-w64-$SYS" --prefix="$HOME/$TARGET" | |
make | |
make install | |
cd ../../flac-$FLAC_VERSION | |
mkdir build | |
cd build | |
../configure --host="$TARGET-w64-$SYS" --prefix="$HOME/$TARGET" --disable-programs --disable-examples --disable-cpplibs | |
make | |
make install | |
cd ../.. | |
- name: 'Download utf8proc' | |
run: | | |
(curl -L https://github.com/JuliaStrings/utf8proc/releases/download/v$UTF8PROC_VERSION/utf8proc-$UTF8PROC_VERSION.tar.gz) | tar -xzvf - | |
- name: 'Build utf8proc' | |
run: | | |
export PATH="$HOME/llvm-mingw/bin:$PATH" | |
cd utf8proc-$UTF8PROC_VERSION | |
mkdir build | |
cd build | |
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="$HOME/$TARGET" -DCMAKE_C_COMPILER="$TARGET-w64-$SYS-clang" -DCMAKE_SYSTEM_NAME="Windows" | |
make | |
make install | |
cd ../.. | |
- name: 'Get date of latest commit' | |
id: date | |
run: | | |
cd schism | |
echo "date=$(git log -n 1 --date=short --format=format:%cd | sed 's/\(....\)-\(..\)-\(..\).*/\1\2\3/')" >> $GITHUB_OUTPUT | |
cd .. | |
- name: 'Build package' | |
run: | | |
export PATH="$HOME/llvm-mingw/bin:$PATH" | |
export PKG_CONFIG_PATH="$HOME/$TARGET/lib/pkgconfig" | |
cd schism | |
autoreconf -I"$HOME/$TARGET/share/aclocal" -i | |
mkdir build | |
cd build | |
../configure --host="$TARGET-w64-$SYS" --prefix="$HOME/$TARGET" --with-sdl-prefix="$HOME/$TARGET" --with-flac LDFLAGS="-Wl,--major-os-version=5,--major-subsystem-version=5" | |
make | |
"$TARGET-w64-$SYS-strip" -g schismtracker.exe | |
cp schismtracker.exe ../.. | |
cd ../.. | |
cp "$HOME/$TARGET/bin/SDL2.dll" . | |
cp "$HOME/$TARGET/bin/libFLAC-12.dll" . | |
cp "$HOME/$TARGET/bin/libogg-0.dll" . | |
"$TARGET-w64-$SYS-strip" -g "SDL2.dll" | |
"$TARGET-w64-$SYS-strip" -g "libFLAC-12.dll" | |
"$TARGET-w64-$SYS-strip" -g "libogg-0.dll" | |
cp schism/docs/configuration.md schism/README.md schism/COPYING . | |
wget https://raw.githubusercontent.com/xiph/flac/master/COPYING.Xiph | |
unix2dos COPYING.Xiph COPYING README.md configuration.md | |
- name: 'Upload artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: schismtracker-${{ steps.date.outputs.date }}-${{ matrix.sys }}-${{ matrix.target }} | |
path: | | |
schismtracker.exe | |
SDL2.dll | |
libFLAC-12.dll | |
libogg-0.dll | |
COPYING | |
COPYING.Xiph | |
README.md | |
configuration.md |