This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
139 lines (117 loc) · 4.34 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
name: Build OpenHack
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
env:
BUILD_TYPE: RelWithDebInfo
jobs:
geode:
strategy:
fail-fast: false
matrix:
config:
- name: Windows
os: windows-latest
name: Geode OpenHack
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build the mod
uses: geode-sdk/build-geode-mod@main
with:
combine: true
ccache-variant: ''
export-pdb: true
build-config: ${{env.BUILD_TYPE}}
configure-args: "-DBUILD_STANDALONE=OFF"
target: ${{ matrix.config.target }}
package-geode:
name: Package Geode Mod
runs-on: ubuntu-latest
needs: ['geode']
steps:
- uses: geode-sdk/build-geode-mod/combine@main
id: build
- uses: actions/upload-artifact@v4
with:
name: OpenHack-Geode
path: ${{ steps.build.outputs.build-output }}
standalone:
name: Vanilla OpenHack
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Ninja
shell: bash
run: |
curl -L https://github.com/ninja-build/ninja/releases/latest/download/ninja-win.zip -o ninja.zip
7z x ninja.zip -o"$GITHUB_WORKSPACE/ninja"
echo "$GITHUB_WORKSPACE/ninja" >> $GITHUB_PATH
- name: Update LLVM
shell: bash
run: |
curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/LLVM-17.0.6-win64.exe -o llvm-inst.exe
7z x llvm-inst.exe -ollvm bin/clang.exe bin/clang++.exe bin/lld-link.exe bin/llvm-rc.exe bin/*.dll lib/clang/*/include/*
echo "$GITHUB_WORKSPACE/llvm/bin" >> $GITHUB_PATH
- name: Configure CMake and build
id: build
shell: bash
run: |
mkdir -p $HOME/.sccache
export CFLAGS="--target=i686-windows-msvc"
export CXXFLAGS="--target=i686-windows-msvc"
export LDFLAGS="--target=i686-windows-msvc"
cmake -B build -DBUILD_GEODE=OFF -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
cmake --build build --config ${{env.BUILD_TYPE}}
- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: OpenHack-Standalone
path: ${{github.workspace}}/bin
package:
name: Create Nightly Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/lemonade'
needs: ['standalone', 'package-geode']
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/bin
merge-multiple: true
- name: Prepare standalone zip
run: |
mkdir -p ${{ github.workspace }}/bin/standalone
cp -r ${{ github.workspace }}/bin/openhack ${{ github.workspace }}/bin/standalone/openhack
cp ${{ github.workspace }}/bin/xinput9_1_0.dll ${{ github.workspace }}/bin/standalone/xinput9_1_0.dll
- name: Package standalone
run: |
7z a -tzip ${{ github.workspace }}/bin/OpenHack-Nightly.zip ${{ github.workspace }}/bin/standalone/*
- name: Get latest release tag
id: get_latest_release
run: echo ::set-output name=tag::$(curl -s https://api.github.com/repos/Prevter/OpenHack/releases/latest | jq -r .tag_name)
- name: Create nightly release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
name: 'Development Release'
body: |
This is a nightly build of OpenHack for commit ${{ github.sha }} (${{ github.event.head_commit.message }}).
You can use this build to test the latest features and changes.
> **Note:** This build is not stable and may contain bugs.
Changes since the last release: https://github.com/Prevter/OpenHack/compare/${{ steps.get_latest_release.outputs.tag }}...nightly
files: |
${{ github.workspace }}/bin/OpenHack-Nightly.zip
${{ github.workspace }}/bin/prevter.openhack.geode
${{ github.workspace }}/bin/prevter.openhack.pdb
${{ github.workspace }}/bin/xinput9_1_0.pdb