-
Notifications
You must be signed in to change notification settings - Fork 8
272 lines (238 loc) · 9.94 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# This is a basic workflow to help you get started with Actions
name: CI Build
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ MINI404 ]
tags:
- "v*"
pull_request:
branches: [ MINI404 ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build_linux:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# if: "!contains(github.event.head_commit.message, 'NO_BUILD')"
# # Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout ${{ github.event.pull_request.head.ref }}
uses: actions/checkout@v3
if: ${{ github.event.pull_request }}
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.sha }}
submodules: false
- name: Checkout ${{ github.event.ref }}
uses: actions/checkout@v3
if: ${{ !github.event.pull_request }}
with:
repository: ${{ github.repository }}
ref: ${{ github.event.ref }}
submodules: false
- name: Cache packages
uses: actions/[email protected]
id: cache-pkgs
with:
path: "packages"
key: "${{ runner.os }}-packages-1_0_0"
restore-keys: ${{ runner.os }}-packages-
- name: Setup cache dir
if: ${{ ! steps.cache-valgrind.outputs.cache-hit }}
run: mkdir -p packages/partial
- name: Install packages
run: |
sudo apt-get update
sudo apt-get -o Dir::Cache::Archives=`pwd`/packages install libelf-dev libglew-dev freeglut3-dev ninja-build libslirp-dev libusb-1.0.0-dev libgtk-3-dev
- name: Cache permissions
run: sudo chmod -R 744 packages
- name: Configure build
run: cd ${{ runner.workspace }}/MINI404 && ./configure --target-list="buddy-softmmu" --enable-libusb --enable-slirp --enable-gtk
- name: Build qemu-system-buddy
run: cd ${{ runner.workspace }}/MINI404/build && ninja
- name: Checkout Wiki
uses: actions/checkout@v3
if: ${{ !github.event.pull_request }}
with:
repository: vintagepc/MINI404.wiki.git
path: ref
ref: master
- name: Regen docs
if: ${{ !github.event.pull_request }}
run: |
cd ${{ runner.workspace }}/MINI404
./updateDocs.sh
cd ${{ runner.workspace }}/MINI404/ref
git add autogen/*
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git diff-index --quiet HEAD || git commit -m "Regen reference docs" && git push
- name: Assemble artifacts
if: ${{ !github.event.pull_request }}
run: |
cd ${{ runner.workspace }}/MINI404/build
mv buddy-softmmu Mini404-dev-linux
mv assets Mini404-dev-linux
mkdir Mini404-dev-linux/pc-bios && mv pc-bios/keymaps Mini404-dev-linux/pc-bios/
tar -jhcvf Mini404-dev-linux.tar.bz2 Mini404-dev-linux
- name: Upload artifact
if: ${{ !github.event.pull_request }}
uses: actions/[email protected]
with:
name: Binaries
path: ${{ runner.workspace }}/MINI404/build/Mini404-dev-linux.tar.bz2
build_macos:
# The type of runner that the job will run on
runs-on: macos-latest
# if: "!contains(github.event.head_commit.message, 'NO_BUILD')"
# # Steps represent a sequence of tasks that will be executed as part of the job
steps:
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout ${{ github.event.pull_request.head.ref }}
uses: actions/checkout@v3
if: ${{ github.event.pull_request }}
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
- name: Checkout ${{ github.event.ref }}
uses: actions/checkout@v3
if: ${{ !github.event.pull_request }}
with:
repository: ${{ github.repository }}
ref: ${{ github.event.ref }}
submodules: true
- name: Install dependencies
run: |
brew install libffi gettext glib pkg-config autoconf automake pixman ninja make
pip3 install setuptools
- name: Configure build
run: cd ${{ runner.workspace }}/MINI404 && ./configure --target-list="buddy-softmmu"
- name: Build qemu-system-buddy
run: cd ${{ runner.workspace }}/MINI404 && gmake -j3
- name: Assemble artifacts
if: ${{ !github.event.pull_request }}
run: |
cd ${{ runner.workspace }}/MINI404/build
mv buddy-softmmu Mini404-dev-macos
mkdir Mini404-dev-macos/pc-bios
mv pc-bios/keymaps Mini404-dev-macos/pc-bios/
tar -jhcvf Mini404-dev-macos.tar.bz2 Mini404-dev-macos
- name: Upload artifact
if: ${{ !github.event.pull_request }}
uses: actions/[email protected]
with:
name: Binaries
path: ${{ runner.workspace }}/MINI404/build/Mini404-dev-macos.tar.bz2
build_msys:
# The type of runner that the job will run on
runs-on: windows-latest
steps:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: make git zip wget mingw-w64-x86_64-diffutils diffutils mingw-w64-x86_64-ninja mingw-w64-x86_64-toolchain mingw-w64-x86_64-gtk3 mingw-w64-x86_64-freeglut mingw-w64-x86_64-glew mingw-w64-x86_64-libusb mingw-w64-x86_64-SDL2 mingw-w64-x86_64-pixman mingw-w64-x86_64-glib2 python-setuptools mingw-w64-x86_64-make mingw-w64-x86_64-curl mingw-w64-x86_64-libjxl mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-pcre
# - name: Install old Python
# run: |
# wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-3.9.13-1-any.pkg.tar.zst
# wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-3.9.13-1-any.pkg.tar.zst.sig
# pacman --noconfirm -U mingw-w64-x86_64-python-3.9.13-1-any.pkg.tar.zst
# shell: msys2 {0}
- name: Fix CRLF Checkout
run: git config --global core.autocrlf false
- name: Checkout ${{ github.event.pull_request.head.ref }}
uses: actions/checkout@v3
if: ${{ github.event.pull_request }}
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.sha }}
submodules: false
- name: Checkout ${{ github.event.ref }}
uses: actions/checkout@v3
if: ${{ !github.event.pull_request }}
with:
repository: ${{ github.repository }}
ref: ${{ github.event.ref }}
submodules: false
# Note we need to sed LDFLAGS_NO_PIE because mingw's LD is no-pie by default and doesn't
# recognize the `--no-pie` argument... not that it matters because we don't need to build the ROMs here.
- name: Configure build
run: |
mkdir build
cd build
../configure --target-list=buddy-softmmu --enable-gtk --enable-libusb --disable-werror
shell: msys2 {0}
- name: Build
run: |
cd build
ninja
shell: msys2 {0}
- name: Assemble artifacts and libraries
run: |
cd build
mkdir Mini404-dev-w64
mv qemu-*.exe Mini404-dev-w64
mv assets Mini404-dev-w64
cd Mini404-dev-w64
mkdir pc-bios && mv ../pc-bios/keymaps pc-bios/
for i in `cat ../../.github/workflows/dll-list.txt`; do echo "Copying $i"; cp /mingw64/bin/$i .; done;
cd ..
zip -r Mini404-dev-w64.zip Mini404-dev-w64
shell: msys2 {0}
- name: Upload Cygwin artifact
if: ${{ !github.event.pull_request }}
uses: actions/[email protected]
with:
name: Binaries
path: ${{ runner.workspace }}/MINI404/build/Mini404-dev-w64.zip
Publish:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request }}
needs: [build_linux, build_msys, build_macos]
steps:
- name: Retrieve platform binaries
uses: actions/[email protected]
with:
name: Binaries
- name: Check tag version
id: get_version
if: startsWith(github.ref, 'refs/tags/v')
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
- name: Build ${{ env.VERSION }} archives
if: startsWith(github.ref, 'refs/tags/v')
run: |
tar -jxvf Mini404-dev-linux.tar.bz2
tar -jxvf Mini404-dev-macos.tar.bz2
unzip Mini404-dev-w64.zip
mv Mini404-dev-linux Mini404-${{ env.VERSION }}-linux
mv Mini404-dev-macos Mini404-${{ env.VERSION }}-macos
mv Mini404-dev-w64 Mini404-${{ env.VERSION }}-w64
tar -jcvf Mini404-${{ env.VERSION }}-linux.tar.bz2 Mini404-${{ env.VERSION }}-linux
tar -jcvf Mini404-${{ env.VERSION }}-macos.tar.bz2 Mini404-${{ env.VERSION }}-macos
zip -r Mini404-${{ env.VERSION }}-w64.zip Mini404-${{ env.VERSION }}-w64
- name: RELEASE THE KRAKEN
if: startsWith(github.ref, 'refs/tags/v')
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
Mini404-${{ env.VERSION }}-linux.tar.bz2
Mini404-${{ env.VERSION }}-macos.tar.bz2
Mini404-${{ env.VERSION }}-w64.zip
- name: Publish prerelease
if: steps.get_version.outcome == 'Skipped'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "dev"
prerelease: true
title: "Latest (Development) Build"
files: |
Mini404-dev-linux.tar.bz2
Mini404-dev-macos.tar.bz2
Mini404-dev-w64.zip