add build info to release (#725)

* attempt to add VC_BUILD_NAME

* fix

* fix

* update macos.yml

* fix

* update macos.yml

* update macos.yml

* add debug step

* update

* update

* fix release.yml

* update cmake

* update WindowControl.cpp

* update workflows

* update release.yml

* add --output-always

* cleanup
This commit is contained in:
MihailRis 2025-12-05 22:11:47 +03:00 committed by ShiftyX1
parent 149f418bed
commit f5868b65f0
7 changed files with 43 additions and 3 deletions

View File

@ -6,6 +6,11 @@ on:
pull_request:
branches: [ "main", "dev" ]
workflow_call:
inputs:
build_name:
required: true
type: string
description: 'Build name passed as VC_BUILD_NAME define'
jobs:
build-appimage:
@ -37,7 +42,7 @@ jobs:
sudo make install
cd ../..
- name: Configure
run: cmake -S . -B build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_APPDIR=1 -DVOXELENGINE_BUILD_TESTS=ON
run: cmake -S . -B build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_APPDIR=1 -DVOXELENGINE_BUILD_TESTS=ON -DVC_BUILD_NAME="${{ inputs.build_name }}"
- name: Build
run: cmake --build build -t install
- name: Run tests

View File

@ -6,6 +6,11 @@ on:
pull_request:
branches: [ "main", "dev" ]
workflow_call:
inputs:
build_name:
required: true
type: string
description: 'Build name passed as VC_BUILD_NAME define'
jobs:
build-dmg:
@ -21,7 +26,7 @@ jobs:
brew install glfw3 glew libpng openal-soft luajit libvorbis skypjack/entt/entt googletest glm
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_TESTS=ON -DVOXELENGINE_BUILD_APPDIR=1
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_TESTS=ON -DVOXELENGINE_BUILD_APPDIR=1 -DVC_BUILD_NAME="${{ inputs.build_name }}"
- name: Build
run: cmake --build build -t install

View File

@ -10,12 +10,27 @@ env:
RELEASE_VERSION: ${{ github.event.inputs.version || 'testrelease' }}
BRANCH_NAME: ${{ github.event_name == 'workflow_dispatch' && github.ref_name || 'main' }}
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- run: echo "exists just for outputs"
outputs:
build_name: '${{ env.RELEASE_VERSION }}'
build_linux:
needs: [prepare]
uses: ./.github/workflows/appimage.yml
with:
build_name: '${{ needs.prepare.outputs.build_name }}'
build_macos:
needs: [prepare]
uses: ./.github/workflows/macos.yml
with:
build_name: '${{ needs.prepare.outputs.build_name }}'
build_windows:
needs: [prepare]
uses: ./.github/workflows/windows-clang.yml
with:
build_name: '${{ needs.prepare.outputs.build_name }}'
publish_release:
runs-on: ubuntu-latest
needs: [build_linux, build_macos, build_windows]

View File

@ -6,6 +6,11 @@ on:
pull_request:
branches: [ "main", "dev" ]
workflow_call:
inputs:
build_name:
required: true
type: string
description: 'Build name passed as VC_BUILD_NAME define'
jobs:
build-windows:
@ -48,7 +53,7 @@ jobs:
export VCPKG_ROOT=$(pwd)/vcpkg
mkdir build
cd build
cmake -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake ..
cmake -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DVC_BUILD_NAME="${{ inputs.build_name }}" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake ..
cmake --build . --config Release
- name: Package for Windows
run: |

View File

@ -10,6 +10,8 @@ execute_process(COMMAND ${CMAKE_COMMAND} --version)
option(VOXELENGINE_BUILD_APPDIR "Pack linux build" OFF)
option(VOXELENGINE_BUILD_TESTS "Build tests" OFF)
add_compile_definitions(VC_BUILD_NAME="${VC_BUILD_NAME}")
# Need for static compilation on Windows with MSVC clang TODO: Make single build
# on Windows to avoid dependence on combinations of platforms and compilers and
# make it independent

View File

@ -37,8 +37,12 @@ WindowControl::Result WindowControl::initialize() {
title += " - ";
}
title += "VoxelCore v" +
#ifdef VC_BUILD_NAME
std::string(VC_BUILD_NAME);
#else
std::to_string(ENGINE_VERSION_MAJOR) + "." +
std::to_string(ENGINE_VERSION_MINOR);
#endif
if (ENGINE_DEBUG_BUILD) {
title += " [debug]";
}

View File

@ -14,6 +14,10 @@ static void sigterm_handler(int signum) {
}
int main(int argc, char** argv) {
#ifdef VC_BUILD_NAME
logger.info() << "build: " << VC_BUILD_NAME;
#endif
CoreParameters coreParameters;
try {
if (!parse_cmdline(argc, argv, coreParameters)) {