Skip to content

Commit

Permalink
Fix workflows to make release builds (#202)
Browse files Browse the repository at this point in the history
Currently the Windows workflow doesn't properly create a release binary.
  • Loading branch information
lionkor authored Dec 9, 2023
2 parents d2329f0 + 9f87edc commit 43b1b05
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push]

env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
CMAKE_BUILD_TYPE: "Release"

jobs:
debian-11-build:
Expand Down Expand Up @@ -147,4 +148,4 @@ jobs:
- name: Test
run: |
chmod +x ./BeamMP-Server-tests
./BeamMP-Server-tests
./BeamMP-Server-tests
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
CMAKE_BUILD_TYPE: "Release"

jobs:
create-release:
Expand All @@ -27,7 +28,7 @@ jobs:
prerelease: true
body: |
Files included in this release:
- `BeamMP-Server.exe` is the windows build.
- `BeamMP-Server.exe` is the windows build. You need to install the [Visual C++ Redistributables](https://aka.ms/vs/17/release/vc_redist.x64.exe) to run this.
- `BeamMP-Server-debian` is a Debian 11 build, requires `liblua5.3-0`.
- `BeamMP-Server-ubuntu` is a Ubuntu 22.04 build, requires `liblua5.3-0`.
Expand Down Expand Up @@ -163,6 +164,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./bin/BeamMP-Server.exe
asset_path: ./bin/Release/BeamMP-Server.exe
asset_name: BeamMP-Server.exe
asset_content_type: application/vnd.microsoft.portable-executable
asset_content_type: application/vnd.microsoft.portable-executable
3 changes: 2 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on: [push]
env:
VCPKG_DEFAULT_TRIPLET: x64-windows-static
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
CMAKE_BUILD_TYPE: "Release"

jobs:
windows-build:
Expand Down Expand Up @@ -38,5 +39,5 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: BeamMP-Server-windows
path: ./bin/BeamMP-Server.exe
path: ./bin/Release/BeamMP-Server.exe

7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ include(FindThreads)
# enables compile_commands.json for clang-related tools (such as the clang LS)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# build debug builds by default (if not specified otherwise)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
# build release builds by default (if not specified otherwise)
if(NOT DEFINED CMAKE_BUILD_TYPE)
message(NOTICE "No build type specified, defaulting to 'Release'")
set(CMAKE_BUILD_TYPE "Release")
endif()

if(UNIX)
Expand Down
2 changes: 1 addition & 1 deletion include/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class Application final {
static inline std::mutex mShutdownHandlersMutex {};
static inline std::deque<TShutdownHandler> mShutdownHandlers {};

static inline Version mVersion { 3, 1, 2 };
static inline Version mVersion { 3, 1, 3 };
};

std::string ThreadName(bool DebugModeOverride = false);
Expand Down
2 changes: 1 addition & 1 deletion scripts/windows/2-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -ex

cmake --build bin --parallel -t BeamMP-Server
cmake --build bin --parallel -t BeamMP-Server --config Release

0 comments on commit 43b1b05

Please sign in to comment.