-
-
Notifications
You must be signed in to change notification settings - Fork 136
214 lines (211 loc) · 5.91 KB
/
gearboy.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
name: Main Workflow
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
pull_request:
schedule:
- cron: '0 0 * * 0'
env:
name-lowercase: gearboy
name-uppercase: Gearboy
jobs:
linux:
name: Linux
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update OS
run: sudo apt-get update -qq
- name: Install dependencies
run: sudo apt-get install -y libsdl2-dev libglew-dev libgtk-3-dev
- name: make
run: make
working-directory: platforms/linux
- name: Prepare artifact directory
run: |
mkdir -p artifact
cp platforms/README.txt artifact
cp platforms/gamecontrollerdb.txt artifact
cp platforms/linux/${{ env.name-lowercase }} artifact
- name: Archive binary
uses: actions/upload-artifact@v4
with:
name: Linux binary (${{ matrix.os }})
path: artifact/*
libretro:
name: Libretro (Ubuntu)
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: make
run: make
working-directory: platforms/libretro
- name: Archive binary
uses: actions/upload-artifact@v4
with:
name: Libretro core (Linux)
path: platforms/libretro/${{ env.name-lowercase }}_libretro.so
macos:
name: macOS
strategy:
matrix:
os: [macos-13, macos-14]
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: brew install sdl2
- name: make
run: make dist
working-directory: platforms/macos
- name: Prepare artifact directory
run: |
mkdir -p artifact
cp platforms/README.txt artifact
cp platforms/gamecontrollerdb.txt artifact
cp platforms/macos/${{ env.name-uppercase }}.app artifact
- name: Archive binary
uses: actions/upload-artifact@v4
with:
name: macOS app bundle (${{ matrix.os }})
path: artifact/*
windows:
name: Windows
runs-on: windows-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Get git version
id: gitversion
shell: bash
run: echo "gitversion=$(git describe --abbrev=7 --dirty --always --tags)" >> $GITHUB_OUTPUT
- name: msbuild
run: msbuild ${{ env.name-uppercase }}.sln /t:Clean,Build /p:EmulatorBuild="${{ steps.gitversion.outputs.gitversion }}" /p:Configuration=Release
working-directory: platforms/windows
- name: Prepare artifact directory
run: |
mkdir -p artifact
cp platforms/README.txt artifact
cp platforms/gamecontrollerdb.txt artifact
cp platforms/windows/dependencies/glew-2.1.0/bin/Release/x64/glew32.dll artifact
cp platforms/windows/dependencies/SDL2-2.28.5/lib/x64/SDL2.dll artifact
cp platforms/windows/release/${{ env.name-uppercase }}.exe artifact
- name: Archive binary
uses: actions/upload-artifact@v4
with:
name: Windows binary
path: artifact/*
bsd:
name: FreeBSD
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: make
id: test
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: pkg install -y git gmake pkgconf SDL2 glew lang/gcc gtk3
run: |
cd platforms/bsd
gmake
- name: Prepare artifact directory
run: |
mkdir -p artifact
cp platforms/README.txt artifact
cp platforms/gamecontrollerdb.txt artifact
cp platforms/bsd/${{ env.name-lowercase }} artifact
- name: Archive binary
uses: actions/upload-artifact@v4
with:
name: BSD binary (FreeBSD)
path: artifact/*
release:
name: Release
needs: [linux, macos, windows]
if: github.event_name != 'pull_request' && startswith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare release directory
run: |
mkdir -p release
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: Windows binary
path: release
- name: Download macOS Intel artifact
uses: actions/download-artifact@v4
with:
name: macos-13 App bundle
path: release
- name: Download macOS ARM artifact
uses: actions/download-artifact@v4
with:
name: macos-14 App bundle
path: release
- name: Download Ubuntu 22.04 artifact
uses: actions/download-artifact@v4
with:
name: Linux (ubuntu-22.04) binary
path: release
- name: Download Ubuntu 20.04 artifact
uses: actions/download-artifact@v4
with:
name: Linux (ubuntu-20.04) binary
path: release
- name: Create release
run: |
cd release
gh release create ${{ github.ref }} \
'${{ github.ref_name }}-windows.zip' \
'${{ github.ref_name }}-macos-intel.zip' \
'${{ github.ref_name }}-macos-arm.zip' \
'${{ github.ref_name }}-ubuntu-22.04.zip' \
'${{ github.ref_name }}-ubuntu-20.04.zip' \
--generate-notes \
--draft
env:
GITHUB_TOKEN: ${{ github.TOKEN }}