-
-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (118 loc) · 4 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
# I stole this from HJFod/CustomKeybinds
name: Build Geode Mod
on:
workflow_dispatch:
push:
branches:
- "main"
env:
GEODE_SDK: ${{ github.workspace }}/sdk
GEODE_VERSION: nightly
CLI_VERSION: v2.4.0
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- name: "Windows"
bin_folder: "windows"
os: windows-2019
extra_flags: '-T host=x64 -A win32'
out_paths: |
./build/Release/*.dll
./build/Release/*.lib
platform_suffix: 'win'
cli_setup: ''
cli_name: 'geode.exe'
- name: "macOS"
bin_folder: "macos"
os: macos-latest
extra_flags: "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13"
out_paths: './build/*.dylib'
platform_suffix: 'mac'
cli_setup: 'chmod a+rwx ./geode'
cli_name: 'geode'
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/checkout@v3
with:
submodules: recursive
repository: geode-sdk/geode
# ref: v0.4.8
path: ${{ env.GEODE_SDK }}
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: Download Geode SDK binaries
run: |
cd ${{ github.workspace }}/sdk
mkdir bin
mkdir bin/nightly
cd bin/nightly
curl -L https://github.com/geode-sdk/geode/releases/download/${{ env.GEODE_VERSION }}/geode-${{ env.GEODE_VERSION }}-${{ matrix.config.platform_suffix }}.zip -o geode-sdk.zip
tar -xf geode-sdk.zip
- name: Download and Unzip CLI
run: |
mkdir ${{ github.workspace }}/cli
cd ${{ github.workspace }}/cli
curl -L https://github.com/geode-sdk/cli/releases/download/${{ env.CLI_VERSION }}/geode-cli-${{ env.CLI_VERSION }}-${{ matrix.config.platform_suffix }}.zip -o geode-cli.zip
tar -xf geode-cli.zip
${{ matrix.config.cli_setup }}
mkdir ${{ github.workspace }}/profile
mkdir ${{ github.workspace }}/profile/geode
mkdir ${{ github.workspace }}/profile/geode/mods
./${{ matrix.config.cli_name }} profile add --name GithubActions ${{ github.workspace }}/profile
- name: Configure CMake
run: |
cd ${{ github.workspace }}
cmake -B build ${{ matrix.config.extra_flags }} -DCLI_PATH=${{ github.workspace }}/cli -DGEODE_DONT_INSTALL_MODS=On
- name: Build
run: |
cd ${{ github.workspace }}/build
cmake --build . --config Release
- uses: actions/upload-artifact@v3
with:
name: "build-${{ matrix.config.bin_folder }}"
path: "${{ matrix.config.out_paths }}"
package:
name: "Package both builds"
# would use linux but theres no cli build for it
runs-on: windows-2019
needs: ['build']
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Download and Unzip CLI
run: |
curl -L https://github.com/geode-sdk/cli/releases/download/${{ env.CLI_VERSION }}/geode-cli-${{ env.CLI_VERSION }}-win.zip -o geode-cli.zip
tar -xf geode-cli.zip
- uses: actions/download-artifact@v3
with:
name: build-windows
- uses: actions/download-artifact@v3
with:
name: build-macos
- name: Display structure of downloaded files
run: ls -R
- name: Merge
shell: bash
run: |
./geode.exe package new .
- uses: actions/upload-artifact@v3
with:
name: Build Output
path: "*.geode"
- uses: geekyeggo/delete-artifact@v2
with:
name: build-windows
failOnError: false
- uses: geekyeggo/delete-artifact@v2
with:
name: build-macos
failOnError: false