forked from schismtracker/schismtracker
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (124 loc) · 5.13 KB
/
mingw.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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