mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 09:47:01 +08:00
* build: add SDL3 dependency * refactor(window): migrate from GLFW to SDL3 for window and input * refactor: remove unused GLFW includes and commented-out code * refactor(input): use relative mouse motion and simplify camera mouse update * refactor(event-handling): guard input events with imgui state Move mouse enable/disable logic into set_imgui_enabled and check imgui_enable before forwarding non-ImGui events to handlers. This prevents duplicate processing and ensures proper mouse state when toggling ImGui. * fix(camera): reset camera on resize events and fix input handling on imgui toggle - Add Camera::player() accessor. - Handle WindowResizeEvent and FrameBufferResizeEvent to reset camera. - Fix escape key handling to disable mouse before toggling imgui. - Fix left alt handling to toggle mouse state correctly. - Reset player key status when toggling imgui. * fix(client_world): add direct exit flag to break connection error loop * refactor(debug): add d_rep template and remove widget ID * feat(debug_collector): add video driver display to debug UI * fix: invert debug flag logic and rename to no_debug The previous 'debug_on' field was never set to true by default, causing debug mode to never be enabled. Now renamed to 'no_debug' and the renderer initializes with debug enabled unless the --no-debug flag is given. * feat(window): add video driver selection via config and --video-driver argument * ci: add vcpkg cache * fix: mscv cpp version show * fix: context delete too early * fix: ci build fail * fix: opengl resource delete error * fix: add // NOLINT for NvOptimusEnablement and AmdPowerXpressRequestHighPerformance * fix: windows ime fail on fullscreen * feat(ui): update text input area on field changes and window resize * fix(ui): initialize m_app pointer to nullptr * feat(window): add exclusive fullscreen support with WM detection * refactor: simplify WM detection and exclusive fullscreen default Removed WindowManager enum; detect_wm() now returns string directly. Default exclusive fullscreen based on platform (true on Linux). Added WM info to debug overlay. * feat: add Alt key to close ImGui; clarify debug log * refactor(dev-panel): remove direct settings UI from settings tab
161 lines
4.2 KiB
YAML
161 lines
4.2 KiB
YAML
name: Release-Build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: Version
|
|
required: false
|
|
default: dev
|
|
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: windows-2022
|
|
platform: windows
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/.vcpkg-cache,readwrite
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
- name: Get Version
|
|
id: version
|
|
shell: bash
|
|
run: |
|
|
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
|
|
VERSION="${GITHUB_REF_NAME#v}"
|
|
else
|
|
VERSION="${{ github.event.inputs.version }}"
|
|
fi
|
|
|
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Setup MSVC
|
|
if: matrix.platform == 'windows'
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
- name: Cache vcpkg
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: .vcpkg-cache
|
|
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-vcpkg-
|
|
- name: Bootstrap vcpkg
|
|
run: |
|
|
git clone https://github.com/microsoft/vcpkg.git
|
|
./vcpkg/bootstrap-vcpkg.bat
|
|
|
|
- name: Configure
|
|
if: matrix.platform == 'windows'
|
|
run: >
|
|
cmake
|
|
-B build
|
|
-G Ninja
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
|
|
-DVCPKG_TARGET_TRIPLET=x64-windows-release
|
|
-DVCPKG_BUILD_TYPE=release
|
|
-DBUILD_TESTING=OFF
|
|
"-DCUBED_VERSION=${{ steps.version.outputs.version }}"
|
|
|
|
- name: Build
|
|
run: cmake --build build --config Release --target Cubed
|
|
|
|
- name: Copy assets
|
|
if: matrix.platform == 'windows'
|
|
shell: pwsh
|
|
run: |
|
|
if (Test-Path assets) {
|
|
Copy-Item -Path assets -Destination build/Cubed -Recurse
|
|
} else {
|
|
Write-Warning "assets folder not found, skipping copy"
|
|
}
|
|
|
|
- name: Create Zip
|
|
if: matrix.platform == 'windows'
|
|
shell: pwsh
|
|
run: |
|
|
Compress-Archive `
|
|
-Path build/Cubed/* `
|
|
-DestinationPath Cubed-${{ steps.version.outputs.version }}-windows-x64.zip
|
|
|
|
####################################################################
|
|
# Upload
|
|
####################################################################
|
|
|
|
- name: Upload Windows Artifacts
|
|
if: matrix.platform == 'windows'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows
|
|
path: |
|
|
*.zip
|
|
|
|
##########################################################################
|
|
# Release
|
|
##########################################################################
|
|
|
|
release:
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Download Artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Generate SHA256
|
|
run: |
|
|
cd artifacts
|
|
|
|
find . -type f | while read file
|
|
do
|
|
sha256sum "$file"
|
|
done > SHA256SUMS
|
|
|
|
- name: Determine prerelease
|
|
id: prerelease
|
|
run: |
|
|
MAIN_BRANCH="${{ github.event.repository.default_branch }}"
|
|
git fetch origin "$MAIN_BRANCH" --depth=1 2>/dev/null || true
|
|
|
|
if git merge-base --is-ancestor "${{ github.sha }}" "origin/$MAIN_BRANCH"; then
|
|
echo "is_prerelease=false" >> $GITHUB_OUTPUT
|
|
echo "is_prerelease=false"
|
|
else
|
|
echo "is_prerelease=true" >> $GITHUB_OUTPUT
|
|
echo "is_prerelease=true"
|
|
fi
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
artifacts/**/*
|
|
artifacts/SHA256SUMS
|
|
generate_release_notes: true
|
|
draft: false
|
|
prerelease: ${{ steps.prerelease.outputs.is_prerelease }} |