Skip to content

Commit

Permalink
Merge pull request #31 from Sak32009/dev
Browse files Browse the repository at this point in the history
varied fixes and improvements
  • Loading branch information
Detanup01 committed Aug 26, 2024
2 parents 1503cc4 + 91eff29 commit b0d92a4
Show file tree
Hide file tree
Showing 27 changed files with 995 additions and 941 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

max_line_length = 120

[*.py]
indent_size = 4

[*.h]
indent_size = 4

[*.cpp]
indent_size = 4
112 changes: 57 additions & 55 deletions .github/workflows/emu-build-all-linux.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build emu (Linux)
name: "Build emu (Linux)"

on:
workflow_call:
Expand All @@ -7,88 +7,90 @@ on:
# allows manual trigger

permissions:
contents: write
contents: "write"

env:
PREMAKE_ACTION: gmake2
DEPS_CACHE_KEY: emu-deps-linux
DEPS_CACHE_DIR: build/deps/linux
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'
THIRD_PARTY_BASE_DIR: "third-party"

jobs:
deps:
name: Restore or build deps
name: "Restore or build deps"
if: ${{ !cancelled() }}
uses: ./.github/workflows/emu-deps-linux.yml
uses: "./.github/workflows/emu-deps-linux.yml"

builds-matrix-linux:
name: build
needs: [ deps ]
runs-on: ubuntu-24.04
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', ]


# 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
# clone branch
- name: "Checkout branch"
uses: actions/checkout@v4

### deps
- name: Restore deps
id: emu-deps-cache-step
# 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 }}
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)
# 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'
ref: "third-party/common/linux"
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/linux"

- name: Clone third-party build helpers (build/linux)
- name: "Clone third-party build helpers (build/linux)"
uses: actions/checkout@v4
with:
ref: 'third-party/build/linux'
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 }}
# 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 }}
# 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
# mandatory Linux packages
- name: "Install required packages"
shell: "bash"
run: |
sudo apt update -y
sudo apt install -y coreutils # echo, printf, etc...
Expand All @@ -100,22 +102,22 @@ jobs:
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
# 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
# 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'
if-no-files-found: "error"
compression-level: 9
retention-days: 1
114 changes: 59 additions & 55 deletions .github/workflows/emu-build-all-win.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build emu (Windows)
name: "Build emu (Windows)"

on:
workflow_call:
Expand All @@ -7,104 +7,108 @@ on:
# allows manual trigger

permissions:
contents: write
contents: "write"

env:
PREMAKE_ACTION: vs2022
DEPS_CACHE_KEY: emu-deps-win
DEPS_CACHE_DIR: build/deps/win
THIRD_PARTY_BASE_DIR: 'third-party'
PREMAKE_ACTION: "vs2022"
DEPS_CACHE_KEY: "emu-deps-win"
DEPS_CACHE_DIR: "build/deps/win"

THIRD_PARTY_BASE_DIR: "third-party"

jobs:
deps:
name: Restore or build deps
name: "Restore or build deps"
if: ${{ !cancelled() }}
uses: ./.github/workflows/emu-deps-win.yml
uses: "./.github/workflows/emu-deps-win.yml"

builds-matrix-win:
name: build
needs: [ deps ]
runs-on: windows-2022
name: "build"
needs: ["deps"]
runs-on: "windows-2022"
if: ${{ !cancelled() }}
continue-on-error: true

strategy:
fail-fast: false
matrix:
prj: [
# regular api
'api_regular',
# (experimental) api + client
'api_experimental', 'steamclient_experimental_stub',
# client (experimental) + loader + extra dll + gameoverlaylib
'steamclient_experimental', 'steamclient_experimental_loader',
'steamclient_experimental_extra', 'lib_game_overlay_renderer',
# tools
'tool_lobby_connect', 'tool_generate_interfaces',
]
arch: [ 'x64', 'Win32', ]
cfg: [ 'debug', 'release', ]

# regular api
"api_regular",
# (experimental) api + client
"api_experimental",
"steamclient_experimental_stub",
# client (experimental) + loader + extra dll + gameoverlaylib
"steamclient_experimental",
"steamclient_experimental_loader",
"steamclient_experimental_extra",
"lib_game_overlay_renderer",
# tools
"tool_lobby_connect",
"tool_generate_interfaces",
]
arch: ["x64", "Win32"]
cfg: ["debug", "release"]

steps:
### on Windows Git will auto change line ending to CRLF, not preferable
- name: Ensure LF line ending
shell: cmd
working-directory: ${{ github.workspace }}
# on Windows Git will auto change line ending to CRLF, not preferable
- name: "Ensure LF line ending"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
git config --local core.autocrlf false
git config --system core.autocrlf false
git config --global core.autocrlf false
### ensure we have msbuild
- name: Add MSBuild to PATH
# ensure we have msbuild
- name: "Add MSBuild to PATH"
uses: microsoft/setup-msbuild@v2

### clone branch
- name: Checkout branch
# clone branch
- name: "Checkout branch"
uses: actions/checkout@v4

### deps
- name: Restore deps
id: emu-deps-cache-step
# 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 }}
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/win)
# extra helpers/tools, these are not built inside the deps build dir
- name: "Clone third-party build helpers (common/win)"
uses: actions/checkout@v4
with:
ref: 'third-party/common/win'
ref: "third-party/common/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win"

- name: Clone third-party deps (build/win)
- name: "Clone third-party deps (build/win)"
uses: actions/checkout@v4
with:
ref: 'third-party/build/win'
ref: "third-party/build/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win"

### generate project files
- name: Generate project files
shell: cmd
working-directory: ${{ github.workspace }}
# generate project files
- name: "Generate project files"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
"${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --genproto --emubuild=${{ github.sha }} --dosstub --winrsrc --winsign --os=windows vs2022
### build target
- name: Build target
shell: cmd
working-directory: ${{ github.workspace }}/build/project/vs2022/win
# build target
- name: "Build target"
shell: "cmd"
working-directory: "${{ github.workspace }}/build/project/vs2022/win"
run: |
msbuild /nologo /target:${{ matrix.prj }} /m:2 /v:n /p:Configuration=${{ matrix.cfg }},Platform=${{ matrix.arch }} gbe.sln
### upload artifact/package to github Actions
- name: Upload target package
# upload artifact/package to github Actions
- name: "Upload target package"
uses: actions/upload-artifact@v4
with:
name: "emu-win-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}"
path: "build/win"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 9
retention-days: 1
Loading

0 comments on commit b0d92a4

Please sign in to comment.