forked from schismtracker/schismtracker
-
Notifications
You must be signed in to change notification settings - Fork 0
253 lines (222 loc) · 8.59 KB
/
Copy pathbuild.yml
File metadata and controls
253 lines (222 loc) · 8.59 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
name: schismtracker build
on:
push:
pull_request:
workflow_dispatch:
jobs:
build-win:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { sys: mingw32, env: i686, win: win32 }
- { sys: mingw64, env: x86_64, win: win64 }
name: build-${{ matrix.win }}
defaults:
run:
shell: msys2 {0}
env:
MINGW_ARCH: ${{ matrix.sys }}
steps:
- name: 'git config'
run: git config --global core.autocrlf input
shell: bash
- name: 'Checkout'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
install: git mingw-w64-${{ matrix.env }}-toolchain mingw-w64-${{ matrix.env }}-flac libtool autoconf automake make mingw-w64-${{ matrix.env }}-SDL2 zip dos2unix
- name: 'Get current date'
id: date
run: echo "date=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: 'Build package'
run: |
autoreconf -i
mkdir build
cd build
../configure
make
strip -g schismtracker.exe
cp schismtracker.exe ..
cd ..
if [ ${{ matrix.win }} == "win32" ]
then
cp /mingw32/bin/libgcc_s_dw2-1.dll .
cp /mingw32/bin/libwinpthread-1.dll .
fi
cp /${{ matrix.sys }}/bin/SDL2.dll .
cp /${{ matrix.sys }}/bin/libFLAC.dll .
cp /${{ matrix.sys }}/bin/libogg-0.dll .
cp docs/configuration.md .
unix2dos COPYING README.md configuration.md
- name: 'Upload artifact (win32)'
if: matrix.win == 'win32'
uses: actions/upload-artifact@v3
with:
name: schismtracker-${{ steps.date.outputs.date }}-${{ matrix.win }}
path: |
schismtracker.exe
SDL2.dll
libFLAC.dll
libogg-0.dll
libgcc_s_dw2-1.dll
libwinpthread-1.dll
COPYING
README.md
configuration.md
- name: 'Upload artifact (win64)'
if: matrix.win == 'win64'
uses: actions/upload-artifact@v3
with:
name: schismtracker-${{ steps.date.outputs.date }}-${{ matrix.win }}
path: |
schismtracker.exe
SDL2.dll
libFLAC.dll
libogg-0.dll
COPYING
README.md
configuration.md
build-macos:
runs-on: macos-11
env:
MACOSX_DEPLOYMENT_TARGET: 10.9
steps:
- name: 'Get current date'
id: date
run: echo "date=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: 'chown SDK directory'
id: chown
run: |
sudo mkdir -p /Library/Developer/CommandLineTools/SDKs/MacOSX10.9.sdk
sudo chown $(whoami) /Library/Developer/CommandLineTools/SDKs/MacOSX10.9.sdk /usr/local/lib
- name: 'Cache SDK'
uses: actions/cache@v3
id: cache
with:
path: '/Library/Developer/CommandLineTools/SDKs/MacOSX10.9.sdk/'
key: 10.9-SDK-Folder
- name: 'Download SDK'
id: download
run: |
if [ -z "$(ls -A /Library/Developer/CommandLineTools/SDKs/MacOSX10.9.sdk)" ]; then
wget -nc "https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.9.sdk.tar.xz"
sudo tar -xJf MacOSX10.9.sdk.tar.xz -C /Library/Developer/CommandLineTools/SDKs/
fi
- name: 'Install dependencies'
run: |
brew install automake zip cmake
- name: 'Checkout'
uses: actions/checkout@v3
# Since Homebrew doesn't provide binaries for old versions, we have to compile our own:
- name: 'Download SDL2 sources'
run: |
curl https://www.libsdl.org/release/SDL2-2.26.1.tar.gz | tar xvf -
- name: 'Build SDL2'
run: |
cd SDL2-2.26.1
./configure CC="sh ../scripts/build-uni.sh"
make
make install
rm -rf arm64 x64
cd ..
- name: 'Download libflac and libogg sources'
run: |
curl https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.4.2.tar.xz | tar -xvf -
curl https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.5.tar.gz | tar -xvf -
- name: 'Build libflac'
run: |
cd libogg-1.3.5
mkdir build
cd build
../configure CC="sh $PWD/../../scripts/build-uni.sh" LDFLAGS="-L/usr/local/lib"
make
make install
cd ../../flac-1.4.2
mkdir build
cd build
../configure CC="sh $PWD/../../scripts/build-uni.sh" LDFLAGS="-L/usr/local/lib"
make
make install
cd ../..
- name: 'Build package'
run: |
autoreconf -i
mkdir -p build
cd build
../configure
make CFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.9.sdk -I/usr/local/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers"
mkdir -p ../buildarm
cd ../buildarm
../configure
make LDFLAGS="-arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk" CFLAGS="-arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -I/usr/local/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers" OBJCFLAGS="-arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers"
cd ..
lipo -create -o schismtracker buildarm/schismtracker build/schismtracker
strip -S schismtracker
cd sys/macosx/Schism_Tracker.app/Contents/
sed -i .bak "s;<string>CFBundle.*Version.*</string>;<string>$(date +%Y%m%d)</string>;" Info.plist
rm Info.plist.bak
mkdir MacOS
cp ../../../../schismtracker MacOS
cp /usr/local/lib/libSDL2-2.0.0.dylib Resources
cp /usr/local/lib/libFLAC.12.dylib Resources
cp /usr/local/lib/libogg.0.dylib Resources
cd MacOS
install_name_tool -change /usr/local/lib/libSDL2-2.0.0.dylib @executable_path/../Resources/libSDL2-2.0.0.dylib schismtracker
install_name_tool -change /usr/local/lib/libFLAC.12.dylib @executable_path/../Resources/libFLAC.12.dylib schismtracker
install_name_tool -change /usr/local/lib/libogg.0.dylib @executable_path/../Resources/libogg.0.dylib schismtracker
cd ../../../../..
cp -r sys/macosx/Schism_Tracker.app Schism\ Tracker.app
cp docs/configuration.md .
zip -r schismtracker.zip configuration.md COPYING README.md Schism\ Tracker.app
- name: 'Upload artifact'
uses: actions/upload-artifact@v3
with:
name: schismtracker-${{ steps.date.outputs.date }}-macos
path: schismtracker.zip
build-linux:
runs-on: ubuntu-latest
steps:
- name: 'Install dependencies'
run: |
sudo apt-get update
sudo apt-get install --fix-missing build-essential automake autoconf autoconf-archive libx11-dev libxext-dev libxv-dev libxxf86vm-dev libsdl2-dev libasound2-dev libflac-dev git libtool zip
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Get current date'
id: date
run: echo "date=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: 'autoreconf -i'
run: autoreconf -i
- name: 'Create source tarball'
run: |
touch schismtracker-${{ steps.date.outputs.date }}.source.tar.gz
tar --exclude=schismtracker-${{ steps.date.outputs.date }}.source.tar.gz --exclude-vcs -zcvf schismtracker-${{ steps.date.outputs.date }}.source.tar.gz *
- name: 'Upload source tarball'
uses: actions/upload-artifact@v3
with:
name: schismtracker-${{ steps.date.outputs.date }}.source
path: schismtracker-${{ steps.date.outputs.date }}.source.tar.gz
- name: 'Build package'
run: |
mkdir -p build
cd build
../configure
make
strip -S schismtracker
cd ..
cp build/schismtracker .
cp docs/configuration.md .
cp sys/posix/schismtracker.1 .
zip schismtracker.zip configuration.md COPYING README.md schismtracker.1 schismtracker
- name: 'Upload artifact'
uses: actions/upload-artifact@v3
with:
name: schismtracker-${{ steps.date.outputs.date }}-linux
path: schismtracker.zip