forked from YaLTeR/BunnymodXT
-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (129 loc) · 4.39 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
159
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 0 1 * *' # Monthly
jobs:
build-linux:
name: Build on Linux (${{ matrix.configuration }})
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
configuration: [Release, Debug]
steps:
- uses: actions/checkout@v2
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
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: i686-unknown-linux-gnu
override: true
- 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@v2
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@v1
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-20.08
options: --privileged
steps:
- uses: actions/checkout@v2
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@v3
with:
manifest-path: build-aux/flatpak/rs.bxt.BunnymodXT.json
cache-key: flatpak-builder-${{ github.sha }}
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: '-CoF'
archive-filename: '3-BunnymodXT-CoF-Windows.7z'
steps:
- uses: actions/checkout@v2
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
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: i686-pc-windows-msvc
override: true
- name: Install Boost
id: install-boost
uses: MarkusJx/[email protected]
with:
boost_version: 1.78.0
- 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@v2
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@v1
with:
files: ${{ matrix.archive-filename }}
draft: true
fail_on_unmatched_files: true