-
Notifications
You must be signed in to change notification settings - Fork 84
121 lines (104 loc) · 3.94 KB
/
emu-build-all-linux.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
name: Build emu (Linux)
on:
workflow_call:
# needed since it allows this to become a reusable workflow
workflow_dispatch:
# allows manual trigger
permissions:
contents: write
env:
PREMAKE_ACTION: gmake2
DEPS_CACHE_KEY: emu-deps-linux
DEPS_CACHE_DIR: build/deps/linux
PACKAGE_BASE_DIR: "build/package/linux"
THIRD_PARTY_BASE_DIR: 'third-party'
jobs:
deps:
name: Restore or build deps
if: ${{ !cancelled() }}
uses: ./.github/workflows/emu-deps-linux.yml
builds-matrix-linux:
name: build
needs: [ deps ]
runs-on: ubuntu-24.04
if: ${{ !cancelled() }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
prj: [
# regular api
'api_regular', 'steamclient_regular',
# api + client (experimental)
'api_experimental', 'steamclient_experimental',
# tools
'tool_lobby_connect', 'tool_generate_interfaces',
]
arch: [ 'x64', 'x32', ]
cfg: [ 'debug', 'release', ]
steps:
### clone branch
- name: Checkout branch
uses: actions/checkout@v4
### deps
- name: Restore deps
id: emu-deps-cache-step
uses: actions/cache@v4
with:
key: ${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}
path: ${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}
## extra helpers/tools, these are not built inside the deps build dir
- name: Clone third-party build helpers (common/linux)
uses: actions/checkout@v4
with:
ref: 'third-party/common/linux'
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/linux"
- name: Clone third-party build helpers (build/linux)
uses: actions/checkout@v4
with:
ref: 'third-party/build/linux'
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/linux"
### fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions to repo folder
shell: bash
working-directory: ${{ github.workspace }}
run: sudo chmod -R 777 "${{ github.workspace }}"
### generate project files
- name: Generate project files
shell: bash
working-directory: ${{ github.workspace }}
run: |
sudo chmod 777 ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5
./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 --file=premake5.lua --genproto --emubuild=${{ github.sha }} --os=linux gmake2
## mandatory Linux packages
- name: Install required packages
shell: bash
run: |
sudo apt update -y
sudo apt install -y coreutils # echo, printf, etc...
sudo apt install -y build-essential
sudo apt install -y gcc-multilib # needed for 32-bit builds
sudo apt install -y g++-multilib
# sudo apt install -y clang
sudo apt install -y libglx-dev # needed for overlay build (header files such as GL/glx.h)
sudo apt install -y libgl-dev # needed for overlay build (header files such as GL/gl.h)
# sudo apt install -y binutils # (optional) contains the tool 'readelf' mainly, and other usefull binary stuff
### build target
- name: Build target
shell: bash
working-directory: ${{ github.workspace }}/build/project/gmake2/linux
run: |
echo "dry run..."
make -n -j 2 config=${{ matrix.cfg }}_${{ matrix.arch }} ${{ matrix.prj }}
echo "actual run..."
make -j 2 config=${{ matrix.cfg }}_${{ matrix.arch }} ${{ matrix.prj }}
### upload artifact/package to github Actions
- name: Upload target package
uses: actions/upload-artifact@v4
with:
name: "emu-linux-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}"
path: "build/linux"
if-no-files-found: 'error'
compression-level: 9
retention-days: 1