-
Notifications
You must be signed in to change notification settings - Fork 131
198 lines (169 loc) · 6.51 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
name: Build Binaries
on:
workflow_dispatch:
push:
branches:
- '**' # every branch
- '!no-build-**' # unless marked as no-build
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- name: "Windows"
os_identifier: "win"
os: windows-2019
prefixes: ''
extra_flags: '-T host=x86 -A win32 -DGEODE_DEBUG=On'
out_paths: './bin/nightly/Geode.pdb ./bin/nightly/Geode.dll ./bin/nightly/GeodeUpdater.exe ./bin/nightly/Geode.lib ./bin/nightly/XInput9_1_0.dll'
cli_cmd: ''
- name: "macOS"
os_identifier: "mac"
os: macos-latest
prefixes: 'PATH="/usr/local/opt/ccache/libexec:$PATH"'
extra_flags: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DGEODE_DEBUG=On -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13"
out_paths: './bin/nightly/Geode.dylib ./bin/nightly/GeodeBootstrapper.dylib ./loader/include/link/libfmod.dylib'
cli_cmd: 'chmod +x $GITHUB_WORKSPACE/cli/geode'
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
if: matrix.config.os_identifier == 'win'
- name: Configure ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.config.os }}
- name: Download CLI
uses: robinraju/release-downloader@v1.5
with:
repository: geode-sdk/cli
latest: true
fileName: "*-${{ matrix.config.os_identifier }}.zip"
tarBall: false
zipBall: false
out-file-path: "cli"
- name: Unzip CLI
run: |
7z x "${{ github.workspace }}/cli/*-${{ matrix.config.os_identifier }}.zip" -o"${{ github.workspace }}/cli"
- name: Add CLI to Path
run: |
${{ matrix.config.cli_cmd }}
echo "${{ github.workspace }}/cli" >> $GITHUB_PATH
- name: Configure CMake
run: >
${{ matrix.config.prefixes }} cmake -B
${{ github.workspace }}/build
${{ matrix.config.extra_flags }}
-DCLI_PATH="${{ github.workspace }}/cli"
-D CMAKE_C_COMPILER_LAUNCHER=ccache
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: |
cd build
cmake --build . --config RelWithDebInfo --parallel
- name: Move to output folder
shell: bash
working-directory: ${{ github.workspace }}
run: |
mkdir ./out
mv ${{ matrix.config.out_paths }} ./out
- name: Get version
uses: juliangruber/read-file-action@v1.1.6
with:
path: ${{ github.workspace }}/VERSION
id: version
- name: Trim whitespace from version
shell: bash
run: echo "VERSION_TRIM=$(echo '${{ steps.version.outputs.content }}' | xargs)" >> $GITHUB_ENV
- name: Delete resource cache file
run: |
rm ./bin/nightly/resources/.geode_cache
- name: Upload resources
uses: actions/upload-artifact@v2
with:
name: resources
path: ./bin/nightly/resources
if: matrix.config.os_identifier == 'win'
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: geode-v${{ env.VERSION_TRIM }}-${{ matrix.config.os_identifier }}
path: ./out
- name: Package MacOS
run: |
cp -R ./bin/nightly/resources ./out/resources
./installer/mac/package.sh ./out ./out/geode-installer-v${{ env.VERSION_TRIM }}-mac.pkg
if: matrix.config.os_identifier == 'mac'
- name: Publish MacOS Installer
uses: actions/upload-artifact@v2
with:
name: geode-installer-v${{ env.VERSION_TRIM }}-mac
path: ./out/geode-installer-v${{ env.VERSION_TRIM }}-mac.pkg
if: matrix.config.os_identifier == 'mac'
- name: Package Windows
run: |
cp -R ./bin/nightly/resources ./out/resources
iwr -useb https://aka.ms/vs/17/release/vc_redist.x86.exe -outfile './installer/windows/VC_redist.x86.exe'
makensis -WX -V3 ./installer/windows/installer.nsi
mv ./installer/windows/GeodeInstaller.exe ./installer/windows/geode-installer-v${{ env.VERSION_TRIM }}-win.exe
if: matrix.config.os_identifier == 'win'
- name: Publish Windows Installer
uses: actions/upload-artifact@v2
with:
name: geode-installer-v${{ env.VERSION_TRIM }}-win
path: ./installer/windows/geode-installer-v${{ env.VERSION_TRIM }}-win.exe
if: matrix.config.os_identifier == 'win'
publish:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Get version
uses: juliangruber/read-file-action@v1.1.6
with:
path: ${{ github.workspace }}/VERSION
id: version
- name: Trim whitespace from version
shell: bash
run: echo "VERSION_TRIM=$(echo '${{ steps.version.outputs.content }}' | xargs)" >> $GITHUB_ENV
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: ${{ github.workspace }}
- name: Move installers
run: |
mv geode-installer-v${{ env.VERSION_TRIM }}-mac.pkg geode-installer-nightly-mac.pkg
mv geode-installer-v${{ env.VERSION_TRIM }}-win.exe geode-installer-nightly-win.exe
- name: Zip MacOS artifacts
uses: vimtor/action-zip@v1
with:
files: geode-v${{ env.VERSION_TRIM }}-mac/Geode.dylib geode-v${{ env.VERSION_TRIM }}-mac/GeodeBootstrapper.dylib
dest: geode-nightly-mac.zip
- name: Zip Windows artifacts
uses: vimtor/action-zip@v1
with:
files: geode-v${{ env.VERSION_TRIM }}-win/XInput9_1_0.dll geode-v${{ env.VERSION_TRIM }}-win/Geode.dll geode-v${{ env.VERSION_TRIM }}-win/GeodeUpdater.exe geode-v${{ env.VERSION_TRIM }}-win/Geode.lib
dest: geode-nightly-win.zip
- name: Update Nightly Release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
name: 'Dev Release'
draft: false
prerelease: true
body: |
Dev release of Geode. Will not install the resources automatically, so you should use the installers to install them.
files: |
./geode-nightly-mac.zip
./geode-nightly-win.zip
./geode-installer-nightly-mac.pkg
./geode-installer-nightly-win.exe