@@ -0,0 +1,120 @@ |
|
|
1 |
name: Build hUGETracker |
|
|
2 |
|
|
|
3 |
on: |
|
|
4 |
- push |
|
|
5 |
|
|
|
6 |
jobs: |
|
|
7 |
build: |
|
|
8 |
strategy: |
|
|
9 |
matrix: |
|
|
10 |
os: |
|
|
11 |
- ubuntu-20.04 |
|
|
12 |
- macos-10.15 |
|
|
13 |
- windows-2019 |
|
|
14 |
include: |
|
|
15 |
- os: ubuntu-20.04 |
|
|
16 |
name: Linux |
|
|
17 |
- os: macos-10.15 |
|
|
18 |
name: Mac |
|
|
19 |
- os: windows-2019 |
|
|
20 |
name: Windows |
|
|
21 |
fail-fast: false |
|
|
22 |
runs-on: ${{ matrix.os }} |
|
|
23 |
steps: |
|
|
24 |
- name: Install Ubuntu dependencies |
|
|
25 |
if: matrix.name == 'Linux' |
|
|
26 |
run: | |
|
|
27 |
sudo apt install lcl-2.0 libsdl2-dev bison |
|
|
28 |
curl -Lo rgbds.tar.gz 'https://github.com/gbdev/rgbds/releases/download/v0.5.1/rgbds-0.5.1.tar.gz' |
|
|
29 |
tar xvf rgbds.tar.gz rgbds/{include,src,Makefile} |
|
|
30 |
cd rgbds |
|
|
31 |
make -j4 rgbasm rgblink rgbfix Q= |
|
|
32 |
|
|
|
33 |
- name: Install macOS dependencies |
|
|
34 |
if: matrix.name == 'Mac' |
|
|
35 |
run: | |
|
|
36 |
brew install --cask lazarus |
|
|
37 |
brew install sdl2 rgbds |
|
|
38 |
mkdir rgbds |
|
|
39 |
for f in asm link fix; do ln -s `which rgb$f` rgbds/rgb$f; done |
|
|
40 |
|
|
|
41 |
- name: Install Windows dependencies |
|
|
42 |
if: matrix.name == 'Windows' |
|
|
43 |
shell: bash |
|
|
44 |
run: | |
|
|
45 |
choco install lazarus |
|
|
46 |
curl -Lo 'sdl2.zip' 'https://www.libsdl.org/release/SDL2-2.0.14-win32-x64.zip' |
|
|
47 |
curl -Lo 'rgbds.zip' 'https://github.com/gbdev/rgbds/releases/download/v0.5.1/rgbds-0.5.1-win64.zip' |
|
|
48 |
unzip -d rgbds rgbds.zip rgb{asm,link,fix}.exe |
|
|
49 |
|
|
|
50 |
- name: Set up MSYS2 |
|
|
51 |
if: matrix.name == 'Windows' |
|
|
52 |
uses: msys2/setup-msys2@v2 |
|
|
53 |
with: |
|
|
54 |
msystem: MINGW64 |
|
|
55 |
path-type: strict |
|
|
56 |
release: false |
|
|
57 |
update: false |
|
|
58 |
install: >- |
|
|
59 |
base-devel |
|
|
60 |
mingw-w64-x86_64-toolchain |
|
|
61 |
yasm |
|
|
62 |
|
|
|
63 |
- name: Compile FFmpeg |
|
|
64 |
if: matrix.name == 'Windows' |
|
|
65 |
shell: msys2 {0} |
|
|
66 |
run: | |
|
|
67 |
curl -Lo lame.tar.gz 'https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz' |
|
|
68 |
tar xf lame.tar.gz |
|
|
69 |
pushd lame-3.100 |
|
|
70 |
./configure --prefix="`realpath ..`/lame-install" --disable-dependency-tracking --disable-shared --enable-nasm --disable-gtktest --disable-decoder --disable-frontend |
|
|
71 |
make |
|
|
72 |
make install |
|
|
73 |
popd |
|
|
74 |
curl -Lo ffmpeg.tar.xz 'http://ffmpeg.org/releases/ffmpeg-4.4.tar.xz' |
|
|
75 |
tar xf ffmpeg.tar.xz |
|
|
76 |
cd ffmpeg-4.4 |
|
|
77 |
./configure --extra-ldflags="-static" --disable-debug --enable-lto --disable-programs --enable-ffmpeg --disable-doc --disable-everything --enable-protocol=pipe --enable-protocol=file --enable-filter=aresample --enable-decoder=pcm_f32le --enable-demuxer=pcm_f32le --enable-encoder=flac --enable-muxer=ogg --enable-muxer=flac --enable-encoder=pcm_s16le --enable-muxer=wav --enable-libmp3lame --enable-encoder=libmp3lame --enable-muxer=mp3 --extra-cflags="-I`realpath ../lame-install/include`" --extra-ldflags="-L`realpath ../lame-install/lib`" |
|
|
78 |
make |
|
|
79 |
|
|
|
80 |
- name: Check out hUGETracker |
|
|
81 |
uses: actions/checkout@v2 |
|
|
82 |
with: |
|
|
83 |
path: hUGETracker |
|
|
84 |
submodules: true # This is intentionally not "recursive", change if needed |
|
|
85 |
|
|
|
86 |
- name: Build release |
|
|
87 |
shell: bash |
|
|
88 |
working-directory: hUGETracker |
|
|
89 |
run: | # The PATH manipulation is because the macOS and Windows installs do NOT put it in the PATH >_< |
|
|
90 |
export PATH="$PATH":/Applications/Lazarus:/c/lazarus |
|
|
91 |
|
|
|
92 |
lazbuild --add-package-link rackctls/RackCtlsPkg.lpk |
|
|
93 |
lazbuild --add-package-link bgrabitmap/bgrabitmap/bgrabitmappack.lpk |
|
|
94 |
|
|
|
95 |
lazbuild hUGETracker.lpi --build-mode="Production ${{ matrix.name }}" |
|
|
96 |
|
|
|
97 |
- name: Package build |
|
|
98 |
shell: bash |
|
|
99 |
run: | # macOS does NOT have `realpath` :) |
|
|
100 |
mkdir packaging |
|
|
101 |
for f in hUGETracker/{Resources/"Sample Songs",hUGEDriver,Resources/Fonts/PixeliteTTF.ttf}; do ln -sv "$PWD/$f" packaging; done |
|
|
102 |
OBJ=`mktemp` |
|
|
103 |
rgbds/rgbasm -i hUGETracker/ -o "$OBJ" hUGETracker/halt.asm |
|
|
104 |
rgbds/rgblink -o packaging/halt.gb -n packaging/halt.sym "$OBJ" |
|
|
105 |
rgbds/rgbfix -vp0xFF packaging/halt.gb |
|
|
106 |
rm "$OBJ" |
|
|
107 |
cp -v hUGETracker/Release/hUGETracker packaging |
|
|
108 |
|
|
|
109 |
- name: Extra Windows packaging |
|
|
110 |
if: matrix.name == 'Windows' |
|
|
111 |
shell: bash |
|
|
112 |
run: | |
|
|
113 |
unzip -d packaging sdl2.zip SDL2.dll |
|
|
114 |
cp -v ffmpeg-4.4/ffmpeg.exe rgbds/* packaging |
|
|
115 |
|
|
|
116 |
- name: Store build |
|
|
117 |
uses: actions/upload-artifact@v2 |
|
|
118 |
with: |
|
|
119 |
name: ${{ matrix.name }} build |
|
|
120 |
path: packaging/ |