forked from RigsOfRods/rigs-of-rods
-
Notifications
You must be signed in to change notification settings - Fork 2
134 lines (113 loc) · 4.25 KB
/
build-game.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
---
name: Build game
on: [ push, pull_request ]
jobs:
build-gcc:
name: Linux build on Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Cache conan
uses: actions/cache@v3
with:
key: conan-ubuntu-${{ hashFiles('conanfile.py') }}
path: ~/.conan2/
- name: Install dependencies
run: |
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-conan.sh" | sudo bash
sudo apt-get update
sudo apt-get -y install \
pkg-config \
ninja-build \
nvidia-cg-toolkit \
libfreetype6-dev \
libfreeimage-dev \
libzzip-dev \
libois-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libx11-dev \
libxt-dev \
libxaw7-dev \
libxrandr-dev \
libopenjp2-7-dev
shell: bash
- name: Configure
run: |
conan profile detect --force
echo "tools.system.package_manager:mode = install" > ~/.conan2/global.conf
echo "tools.system.package_manager:sudo = True" >> ~/.conan2/global.conf
conan remote add ror-conan https://git.anotherfoxguy.com/api/packages/rorbot/conan -f
conan install . -s build_type=Release -b missing -pr:b=default -c tools.cmake.cmaketoolchain:generator="Ninja"
cmake --preset conan-release -DCMAKE_INSTALL_PREFIX=redist -DCREATE_CONTENT_FOLDER=ON
shell: bash
- name: Build
run: ninja install
shell: bash
- name: Copy *.so files
run: cmake -P ./tools/CI/copy_libs.cmake
shell: bash
- name: Upload build to itch.io
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
if: env.BUTLER_API_KEY != null && github.ref == 'refs/heads/master'
run: |
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-butler.sh" | sudo bash
butler push redist rigs-of-rods/rigs-of-rods-dev:linux-ci --userversion CIBuild-${GITHUB_RUN_NUMBER}-commit-${GITHUB_SHA}
shell: bash
- name: Upload redist folder
uses: actions/upload-artifact@v3
with:
name: ror-linux
path: redist
- name: Clean Conan pkgs
run: conan cache clean "*" -sbd
shell: bash
build-msvc:
name: Windows build
runs-on: windows-2019
env:
BUILD_TOOLS_PATH: C:\apps\build-tools\
CONAN_USER_HOME_SHORT: None
steps:
- run: echo $env:BUILD_TOOLS_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Build tools
run: git clone https://git.anotherfoxguy.com/AnotherFoxGuy/build-tools.git %BUILD_TOOLS_PATH%
shell: cmd
- name: Cache conan packages
uses: actions/cache@v3
with:
key: conan-windows-${{ hashFiles('conanfile.py') }}
path: ~/.conan2
- name: Enable Developer Command Prompt
uses: ilammy/[email protected]
- name: Configure
run: |
conan remote add ror-conan https://git.anotherfoxguy.com/api/packages/rorbot/conan -f
conan install . -b missing -pr:b=tools/conan-profiles/vs-19-release-ninja -pr=tools/conan-profiles/vs-19-release-ninja
cmake --preset conan-release -DCMAKE_INSTALL_PREFIX=redist -DCREATE_CONTENT_FOLDER=ON
shell: cmd
- name: Build
run: ninja install
shell: cmd
- name: Upload build to itch.io
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
if: env.BUTLER_API_KEY != null && github.ref == 'refs/heads/master'
run: |
choco install butler -y
butler push redist rigs-of-rods/rigs-of-rods-dev:windows-ci --userversion CIBuild-%GITHUB_RUN_NUMBER%-Commit-%GITHUB_SHA%
shell: cmd
- name: Upload redist folder
uses: actions/upload-artifact@v3
with:
name: ror-win
path: redist
- name: Clean Conan pkgs
run: conan cache clean "*" -sbd
shell: cmd