-
Notifications
You must be signed in to change notification settings - Fork 37
158 lines (128 loc) · 4.43 KB
/
main.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
name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *' # Monthly
jobs:
build-linux:
name: Build on Linux (${{ matrix.configuration }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
configuration: [Release, Debug]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# We need the full history to find the tag
fetch-depth: 0
# We need the tags for the version string
- run: git fetch --force --tags
- name: Install dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install g++-multilib libboost-dev mesa-common-dev ninja-build libgl-dev:i386
- name: Install Rust
run: |
rustup toolchain install stable --profile minimal
rustup override set stable
rustup target add i686-unknown-linux-gnu
- name: Generate the build system
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.configuration }}
- name: Build
run: cmake --build build
- uses: actions/upload-artifact@v4
with:
name: BunnymodXT-${{ runner.os }}-${{ matrix.configuration }}
path: build/libBunnymodXT.so
- name: Prepare Release
if: startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release'
run: |
cp build/libBunnymodXT.so .
7z a 2-BunnymodXT-${{ runner.os }}.7z libBunnymodXT.so LICENSE
- name: Release
if: startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release'
uses: softprops/action-gh-release@v2
with:
files: 2-BunnymodXT-${{ runner.os }}.7z
draft: true
fail_on_unmatched_files: true
build-flatpak:
name: Build under Flatpak
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08
options: --privileged
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# We need the full history to find the tag
fetch-depth: 0
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
# We need the tags for the version string
- run: git fetch --force --tags
- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6
with:
manifest-path: build-aux/flatpak/rs.bxt.BunnymodXT.json
cache: false
build-windows:
name: Build on Windows (${{ matrix.configuration }}, COF=${{ matrix.cof }})
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
configuration: [Release, Debug]
cof: ['OFF', 'ON']
include:
- cof: 'OFF'
archive-filename: '1-BunnymodXT-Windows.7z'
- cof: 'ON'
artifact-label: '-CoFSteam'
archive-filename: '3-BunnymodXT-CoFSteam-Windows.7z'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# We need the full history to find the tag
fetch-depth: 0
# We need the tags for the version string
- run: git fetch --force --tags
- name: Install Rust
run: |
rustup toolchain install stable --profile minimal
rustup override set stable
rustup target add i686-pc-windows-msvc
- name: Install Boost
id: install-boost
uses: MarkusJx/[email protected]
with:
boost_version: 1.78.0
platform_version: 2019
toolset: msvc
- name: Generate the build system
run: cmake -B build -A Win32 -DCOF=${{ matrix.cof }}
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build
run: cmake --build build --config ${{ matrix.configuration }} -j $env:NUMBER_OF_PROCESSORS
- uses: actions/upload-artifact@v4
with:
name: BunnymodXT${{ matrix.artifact-label }}-${{ runner.os }}-${{ matrix.configuration }}
path: build\${{ matrix.configuration }}\BunnymodXT.dll
- name: Prepare Release
if: startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release'
run: |
cp build/${{ matrix.configuration }}/BunnymodXT.dll .
7z a ${{ matrix.archive-filename }} BunnymodXT.dll LICENSE
- name: Release
if: startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release'
uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.archive-filename }}
draft: true
fail_on_unmatched_files: true