Skip to content

Commit

Permalink
Merge pull request #9 from Pika-Software/dev
Browse files Browse the repository at this point in the history
1.3.0
  • Loading branch information
dankmolot authored Jul 3, 2023
2 parents 2c3cb39 + 235f41e commit 8e47d51
Show file tree
Hide file tree
Showing 22 changed files with 1,389 additions and 328 deletions.
51 changes: 35 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ on:
- '**.txt'
- '.github/workflows/build.yml'
workflow_dispatch:
pull_request:

env:
GIT_BRANCH: ${{ github.ref_type == 'branch' && github.ref_name || 'release' }}
BUILD_TYPE: ${{ (github.ref_type != 'branch' || github.ref_name == 'main') && 'Release' || 'Debug' }}

jobs:
windows:
Expand All @@ -36,16 +39,17 @@ jobs:
cmake -B build -S . -A Win32 `
-DGARRYSMOD_COMMON_PATH="third-party/garrysmod_common" `
-DAUTOINSTALL="." `
-DBUILD_SHARED_LIBS=OFF
-DBUILD_SHARED_LIBS=OFF `
-DGIT_BRANCH="$env:GIT_BRANCH"
- name: '[x32] Build project (Serverside)'
run: cmake --build build --config Release -j -t moonloader
run: cmake --build build --config $env:BUILD_TYPE -j -t moonloader

- name: '[x32] Configure project (Clientside)'
run: cmake -B build -S . -DCLIENT_DLL=ON

- name: '[x32] Build project (Clientside)'
run: cmake --build build --config Release -j -t moonloader
run: cmake --build build --config $env:BUILD_TYPE -j -t moonloader

- name: '[x64] Download garrysmod_common'
uses: actions/checkout@v3
Expand All @@ -60,16 +64,17 @@ jobs:
cmake -B build64 -S . -A x64 `
-DGARRYSMOD_COMMON_PATH="third-party/garrysmod_common64" `
-DAUTOINSTALL="." `
-DBUILD_SHARED_LIBS=OFF
-DBUILD_SHARED_LIBS=OFF `
-DGIT_BRANCH="$env:GIT_BRANCH"
- name: '[x64] Build project (Serverside)'
run: cmake --build build64 --config Release -j -t moonloader
run: cmake --build build64 --config $env:BUILD_TYPE -j -t moonloader

- name: '[x64] Configure project (Clientside)'
run: cmake -B build64 -S . -DCLIENT_DLL=ON

- name: '[x64] Build project (Clientside)'
run: cmake --build build64 --config Release -j -t moonloader
run: cmake --build build64 --config $env:BUILD_TYPE -j -t moonloader

- name: "Upload artifacts"
uses: actions/upload-artifact@v3
Expand All @@ -79,6 +84,14 @@ jobs:
./*.dll
if-no-files-found: error

- name: "Upload debug artifacts"
uses: actions/upload-artifact@v3
if: ${{ env.BUILD_TYPE == 'Debug' }}
with:
name: Windows
path: |
./*.pdb
linux:
runs-on: ubuntu-20.04 # Using ubuntu 20.04 since we want to use old gcc version to ensure compatibility
steps:
Expand All @@ -104,16 +117,18 @@ jobs:
-DGARRYSMOD_COMMON_PATH="third-party/garrysmod_common" \
-DAUTOINSTALL="." \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32"
-DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32" \
-DGIT_BRANCH="$GIT_BRANCH" \
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
- name: '[x32] Build project (Serverside)'
run: cmake --build build --config Release -j -t moonloader
run: cmake --build build -j -t moonloader

- name: '[x32] Configure project (Clientside)'
run: cmake -B build -S . -DCLIENT_DLL=ON

- name: '[x32] Build project (Clientside)'
run: cmake --build build --config Release -j -t moonloader
run: cmake --build build -j -t moonloader

- name: '[x64] Download garrysmod_common'
uses: actions/checkout@v3
Expand All @@ -128,16 +143,18 @@ jobs:
cmake -B build64 -S . \
-DGARRYSMOD_COMMON_PATH="third-party/garrysmod_common64" \
-DAUTOINSTALL="." \
-DBUILD_SHARED_LIBS=OFF
-DBUILD_SHARED_LIBS=OFF \
-DGIT_BRANCH="$GIT_BRANCH" \
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
- name: '[x64] Build project (Serverside)'
run: cmake --build build64 --config Release -j -t moonloader
run: cmake --build build64 -j -t moonloader

- name: '[x64] Configure project (Clientside)'
run: cmake -B build64 -S . -DCLIENT_DLL=ON

- name: '[x64] Build project (Clientside)'
run: cmake --build build64 --config Release -j -t moonloader
run: cmake --build build64 -j -t moonloader

- name: "Upload artifacts"
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -167,16 +184,18 @@ jobs:
cmake -B build64 -S . \
-DGARRYSMOD_COMMON_PATH="third-party/garrysmod_common64" \
-DAUTOINSTALL="." \
-DBUILD_SHARED_LIBS=OFF
-DBUILD_SHARED_LIBS=OFF \
-DGIT_BRANCH="$GIT_BRANCH" \
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
- name: '[x64] Build project (Serverside)'
run: cmake --build build64 --config Release -j -t moonloader
run: cmake --build build64 -j -t moonloader

- name: '[x64] Configure project (Clientside)'
run: cmake -B build64 -S . -DCLIENT_DLL=ON

- name: '[x64] Build project (Clientside)'
run: cmake --build build64 --config Release -j -t moonloader
run: cmake --build build64 -j -t moonloader

- name: "Upload artifacts"
uses: actions/upload-artifact@v3
Expand Down
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ endif()
# Include extensions
add_subdirectory(cmake)

# CmakeRC compiler
file(DOWNLOAD "https://raw.githubusercontent.com/vector-of-bool/cmrc/master/CMakeRC.cmake"
"${CMAKE_BINARY_DIR}/CMakeRC.cmake")
include("${CMAKE_BINARY_DIR}/CMakeRC.cmake")

# Entropia File System Watcher
add_subdirectory(third-party/efsw)

Expand All @@ -57,8 +52,18 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Get the current working branch
if(NOT DEFINED GIT_BRANCH)
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()

project(gm_moonloader
VERSION 1.2.0
VERSION 1.3.0
LANGUAGES CXX
HOMEPAGE_URL "https://github.com/Pika-Software/gm_moonloader"
)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.3.0
1 change: 1 addition & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include(find_garrysmod_common.cmake)
include(CMakeRC.cmake)
Loading

0 comments on commit 8e47d51

Please sign in to comment.