2024-05-20 04:05:53 +03:00
|
|
|
name: Build emu (Linux)
|
2024-05-11 13:13:59 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
# needed since it allows this to become a reusable workflow
|
|
|
|
workflow_dispatch:
|
|
|
|
# allows manual trigger
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2024-05-20 03:12:20 +03:00
|
|
|
env:
|
2024-05-31 12:24:38 +03:00
|
|
|
PREMAKE_ACTION: gmake2
|
2024-05-20 03:12:20 +03:00
|
|
|
DEPS_CACHE_KEY: emu-deps-linux
|
|
|
|
DEPS_CACHE_DIR: build/deps/linux
|
|
|
|
|
|
|
|
PACKAGE_BASE_DIR: "build/package/linux"
|
|
|
|
THIRD_PARTY_BASE_DIR: 'third-party'
|
|
|
|
|
2024-05-11 13:13:59 +03:00
|
|
|
jobs:
|
|
|
|
deps:
|
|
|
|
name: Restore or build deps
|
|
|
|
if: ${{ !cancelled() }}
|
2024-05-11 15:18:05 +03:00
|
|
|
uses: ./.github/workflows/emu-deps-linux.yml
|
2024-05-11 13:13:59 +03:00
|
|
|
|
2024-05-20 03:12:20 +03:00
|
|
|
builds-matrix-linux:
|
2024-05-20 04:18:53 +03:00
|
|
|
name: build
|
2024-05-11 13:13:59 +03:00
|
|
|
needs: [ deps ]
|
2024-05-20 03:12:20 +03:00
|
|
|
runs-on: ubuntu-22.04
|
2024-05-11 13:13:59 +03:00
|
|
|
if: ${{ !cancelled() }}
|
2024-05-20 04:05:53 +03:00
|
|
|
continue-on-error: true
|
2024-05-20 03:12:20 +03:00
|
|
|
|
|
|
|
strategy:
|
2024-05-20 04:05:53 +03:00
|
|
|
fail-fast: false
|
2024-05-20 03:12:20 +03:00
|
|
|
matrix:
|
2024-05-22 05:38:40 +03:00
|
|
|
prj: [
|
|
|
|
# regular api
|
2024-05-31 12:24:38 +03:00
|
|
|
'api_regular', 'steamclient_regular',
|
2024-05-22 05:38:40 +03:00
|
|
|
# api + client (experimental)
|
|
|
|
'api_experimental', 'steamclient_experimental',
|
|
|
|
# tools
|
|
|
|
'tool_lobby_connect', 'tool_generate_interfaces',
|
|
|
|
]
|
2024-05-20 04:16:43 +03:00
|
|
|
arch: [ 'x64', 'x32', ]
|
2024-05-20 13:07:01 +02:00
|
|
|
cfg: [ 'debug', 'release', ]
|
2024-05-20 04:16:43 +03:00
|
|
|
|
2024-05-20 03:12:20 +03:00
|
|
|
|
|
|
|
steps:
|
2024-05-20 03:15:21 +03:00
|
|
|
### clone branch
|
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2024-05-20 03:12:20 +03:00
|
|
|
### deps
|
|
|
|
- name: Restore deps
|
|
|
|
id: emu-deps-cache-step
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
2024-05-31 12:24:38 +03:00
|
|
|
key: ${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}
|
|
|
|
path: ${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}
|
2024-05-20 03:12:20 +03:00
|
|
|
|
|
|
|
## 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 }}
|
2024-05-31 12:24:38 +03:00
|
|
|
run: sudo chmod -R 777 "${{ github.workspace }}"
|
|
|
|
|
2024-05-31 14:39:06 +03:00
|
|
|
### 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
|
2024-05-31 15:09:36 +03:00
|
|
|
./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 --file=premake5.lua --genproto --emubuild=${{ github.sha }} --os=linux gmake2
|
2024-05-31 14:39:06 +03:00
|
|
|
|
2024-05-31 12:24:38 +03:00
|
|
|
## mandatory Linux packages
|
|
|
|
- name: Install required packages
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-05-31 12:29:52 +03:00
|
|
|
sudo apt update -y
|
2024-05-31 12:24:38 +03:00
|
|
|
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
|
2024-05-20 03:12:20 +03:00
|
|
|
|
2024-05-31 14:39:06 +03:00
|
|
|
### build target
|
|
|
|
- name: Build target
|
2024-05-20 03:12:20 +03:00
|
|
|
shell: bash
|
2024-05-20 13:15:54 +02:00
|
|
|
working-directory: ${{ github.workspace }}/build/project/gmake2/linux
|
2024-05-20 03:12:20 +03:00
|
|
|
run: |
|
2024-05-20 03:27:51 +03:00
|
|
|
echo "dry run..."
|
2024-05-31 12:24:38 +03:00
|
|
|
make -n -j 2 config=${{ matrix.cfg }}_${{ matrix.arch }} ${{ matrix.prj }}
|
2024-05-20 03:27:51 +03:00
|
|
|
echo "actual run..."
|
2024-05-31 12:24:38 +03:00
|
|
|
make -j 2 config=${{ matrix.cfg }}_${{ matrix.arch }} ${{ matrix.prj }}
|
2024-05-20 03:12:20 +03:00
|
|
|
|
2024-05-31 15:34:28 +03:00
|
|
|
### upload artifact/package to github Actions
|
|
|
|
- name: Upload target package
|
2024-05-20 03:12:20 +03:00
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: "emu-linux-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}"
|
2024-06-02 20:43:17 +03:00
|
|
|
path: "build/linux"
|
2024-05-20 03:12:20 +03:00
|
|
|
if-no-files-found: 'error'
|
|
|
|
compression-level: 9
|
|
|
|
retention-days: 1
|