From 550e21c8c32628be2837d979e3d0289b691d4f20 Mon Sep 17 00:00:00 2001 From: ASpoonPlaysGames <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Mon, 4 Sep 2023 18:22:16 +0100 Subject: [PATCH 1/2] imagine if this works first try --- .github/workflows/ci.yml | 7 +++++++ NorthstarDLL/util/version.cpp | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 897551749..ba3b2e03f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,7 @@ on: [push, pull_request] env: BUILD_PROFILE: Release + NORTHSTAR_VERSION: 0.0.0.${{github.run_number}} jobs: build: @@ -16,6 +17,12 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 - name: Configure cmake run: cmake -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="${{ env.BUILD_PROFILE }}" + - name: Setup resource file version + shell: bash + run: | + sed -i 's/DEV/${{ env.NORTHSTAR_VERSION }}/g' NorthstarLauncher/resources.rc + FILEVERSION=$(echo ${{ env.NORTHSTAR_VERSION }} | tr '.' ',' | sed -E 's/-rc[0-9]+//' | tr -d '[:alpha:]') + sed -i "s/0,0,0,1/${FILEVERSION}/g" NorthstarDLL/ns_version.h - name: Build run: cmake --build . - name: Extract Short Commit Hash diff --git a/NorthstarDLL/util/version.cpp b/NorthstarDLL/util/version.cpp index 1ad624384..a947cde18 100644 --- a/NorthstarDLL/util/version.cpp +++ b/NorthstarDLL/util/version.cpp @@ -11,9 +11,9 @@ void InitialiseVersion() int ua_len = 0; // We actually use the rightmost integer do determine whether or not we're a debug/dev build - // If it is set to 1, we are a dev build - // On github CI, we set this 1 to a 0 automatically as we replace the 0,0,0,1 with the real version number - if (northstar_version[3] == 1) + // If it is set to a non-zero value, we are a dev build + // On github CI, we set this to a 0 automatically as we replace the 0,0,0,1 with the real version number + if (northstar_version[3]) { sprintf(version, "%d.%d.%d.%d+dev", northstar_version[0], northstar_version[1], northstar_version[2], northstar_version[3]); ua_len += snprintf( From 952160d6838987c9c401cef2c8be1d53ce7d4bc0 Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Sat, 16 Sep 2023 15:07:10 +0100 Subject: [PATCH 2/2] Set version number on Northstar.dll --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba3b2e03f..09af4df79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,7 @@ jobs: shell: bash run: | sed -i 's/DEV/${{ env.NORTHSTAR_VERSION }}/g' NorthstarLauncher/resources.rc + sed -i 's/DEV/${{ env.NORTHSTAR_VERSION }}/g' NorthstarDLL/resources.rc FILEVERSION=$(echo ${{ env.NORTHSTAR_VERSION }} | tr '.' ',' | sed -E 's/-rc[0-9]+//' | tr -d '[:alpha:]') sed -i "s/0,0,0,1/${FILEVERSION}/g" NorthstarDLL/ns_version.h - name: Build