-
Notifications
You must be signed in to change notification settings - Fork 16
245 lines (211 loc) · 7.67 KB
/
build.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
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
name: build
on:
# Run on pushes to tags, the "master" branch, and PR's
push:
branches:
- master
paths-ignore:
- '**.md'
- '*.txt'
- '.gitignore'
pull_request:
paths-ignore:
- '**.md'
- '*.txt'
- '.gitignore'
workflow_dispatch:
jobs:
windows:
name: ${{ matrix.build_type }} Windows ${{ matrix.arch }}
runs-on: windows-2019
strategy:
matrix:
build_type: [Release]
arch: [ x86 ]
include:
- arch: x86
platform: Win32
pkg_suffix: x86
steps:
- uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -A ${{ matrix.platform }} -T v141_xp
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }}
- name: Install
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --install . --config ${{ matrix.build_type }}
- name: Update readme
working-directory: ${{runner.workspace}}/jaMME/build/mme
shell: bash
run: |
sed -i "s/Date: .*..*..*/Date: $(date +"%d.%m.%Y")/" readme.txt
sed -i "s/Revision: .*/Revision: "$(git rev-parse --short HEAD)"/" readme.txt
- name: Create binary archive
working-directory: ${{runner.workspace}}/jaMME/build
shell: bash
run: |
rm start_jaMME.command
rm start_jaMME.sh
- uses: actions/upload-artifact@v4
with:
name: jamme-windows-${{ matrix.arch }}
path: ${{runner.workspace}}/jaMME/build/
if-no-files-found: error
ubuntu:
name: ${{ matrix.config }} Ubuntu ${{ matrix.arch }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
arch: [x86, x86_64]
cc: [gcc]
cxx: [g++]
include:
- config: Release
rule: install
- arch: x86
use_sdl: true
- arch: x86_64
use_sdl: true
steps:
- uses: actions/checkout@v4
- name: Create Build Environment
run: |
if [ ${{ matrix.arch }} == "x86" ]; then
sudo dpkg --add-architecture i386
sudo apt-get -qq update
sudo apt-get -y install aptitude
sudo apt-get -y install --allow-downgrades libpcre2-8-0=10.34-7 gcc-multilib g++-multilib ninja-build libjpeg-dev:i386 libpng-dev:i386 libcurl4-openssl-dev:i386 libmad0-dev:i386
sudo aptitude -y install libglib2.0-dev:i386 libsdl2-dev:i386
else
sudo apt-get -qq update
sudo apt-get install libjpeg-dev libpng-dev zlib1g-dev libsdl2-dev libmad0-dev
fi
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
if [ ${{ matrix.arch }} == "x86" ]; then
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBuildAIO=OFF -DBuildCurl=OFF -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install -DCMAKE_TOOLCHAIN_FILE=CMakeModules/Toolchains/linux-i686.cmake
else
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBuildAIO=OFF -DBuildCurl=OFF -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install
fi
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build .
- name: Install
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --install .
- name: Update readme
working-directory: ${{runner.workspace}}/jaMME/build/mme
shell: bash
run: |
sed -i "s/Date: .*..*..*/Date: $(date +"%d.%m.%Y")/" readme.txt
sed -i "s/Revision: .*/Revision: "$(git rev-parse --short HEAD)"/" readme.txt
- name: Create binary archive
working-directory: ${{runner.workspace}}/jaMME/build
shell: bash
run: |
chmod +x jamme
chmod +x start_jaMME.sh
rm start_jaMME.command
rm start_jaMME.cmd
tar -cvf jamme-linux-${{ matrix.arch }}.tar ./*
- uses: actions/upload-artifact@v4
if: matrix.cc == 'gcc' && matrix.config == 'Release'
with:
name: jamme-linux-${{ matrix.arch }}
path: ${{runner.workspace}}/jaMME/build/jamme-linux-${{ matrix.arch }}.tar
if-no-files-found: error
macos:
name: ${{ matrix.config }} macOS ${{ matrix.arch }}
runs-on: macos-13
strategy:
fail-fast: false
matrix:
arch: [x86_64]
cc: [clang]
cxx: [clang++]
include:
- config: Release
rule: install
steps:
- uses: actions/checkout@v4
- name: Create Build Environment
run: |
brew install zlib libjpeg sdl2
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build .
- name: Install
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --install .
- name: Update readme
working-directory: ${{runner.workspace}}/jaMME/build/mme
shell: bash
run: |
sed -i.bak "s/Date: .*..*..*/Date: $(date +"%d.%m.%Y")/" readme.txt
sed -i.bak "s/Revision: .*/Revision: "$(git rev-parse --short HEAD)"/" readme.txt
rm readme.txt.bak
- name: Create binary archive
working-directory: ${{runner.workspace}}/jaMME/build
shell: bash
run: |
chmod +x jamme.app/Contents/MacOS/jamme
chmod +x start_jaMME.command
rm start_jaMME.cmd
rm start_jaMME.sh
tar -cvf jamme-macos-${{ matrix.arch }}.tar ./*
- uses: actions/upload-artifact@v4
if: matrix.cc == 'clang' && matrix.config == 'Release'
with:
name: jamme-macos-${{ matrix.arch }}
path: ${{runner.workspace}}/jaMME/build/jamme-macos-${{ matrix.arch }}.tar
if-no-files-found: error
create-release:
if: github.ref == 'refs/heads/master' && github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: [windows, ubuntu, macos]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -R
- name: Create binary archives
run: |
7z a -r jamme-linux-x86.zip ./jamme-linux-x86/*
7z a -r jamme-linux-x86_64.zip ./jamme-linux-x86_64/*
7z a -r jamme-windows-x86.zip ./jamme-windows-x86/*
7z a -r jamme-macos-x86_64.zip ./jamme-macos-x86_64/*
- name: Create latest build
uses: crowbarmaster/GH-Automatic-Releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: "latest"
prerelease: false
title: Latest Build
files: |
*.zip