From e4a7a0df389231b614e2204ce5801fc1cb00aebf Mon Sep 17 00:00:00 2001 From: Jacques Heunis Date: Fri, 30 Aug 2024 20:21:30 +0100 Subject: [PATCH] Finalise v1.10.1, which fixes v1.10 reporting empty string as its version --- .github/workflows/release.yml | 15 +++++++++------ build/generate_version_header.ps1 | 5 +++++ src/main.cpp | 3 +++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9997cb9..938506f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,16 +18,19 @@ jobs: needs: run-tests steps: - - name: Print installed Windows SDK versions - shell: pwsh - continue-on-error: true - run: Get-ChildItem -Name "HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots" - - name: Add MSBuild to the PATH uses: microsoft/setup-msbuild@v2 - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all the history so that `git describe` works to generate the version header + fetch-tags: true + + - name: Print git tag description + shell: pwsh + continue-on-error: false + run: git describe HEAD - name: Build 32-bit binary run: msbuild /r /m /p:Configuration=Release /p:Platform=x86 build\foo_openlyrics.sln @@ -61,7 +64,7 @@ jobs: - name: Create GitHub release id: release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: | ${{ env.RELEASE_NAME }}.fb2k-component diff --git a/build/generate_version_header.ps1 b/build/generate_version_header.ps1 index f312693..86d8b5e 100644 --- a/build/generate_version_header.ps1 +++ b/build/generate_version_header.ps1 @@ -3,6 +3,11 @@ param ( [string]$output_path ) $version_string = git describe HEAD +if ([string]::IsNullOrEmpty($version_string)) { + Write-Output "Failed to compute commit description, git returned an empty string, terminating..." + return 1 +} + if ($version_string[0] -Ne 'v') { Write-Output "Current commit description ""$version_string"" does not have the expected format, terminating..." Return 1 diff --git a/src/main.cpp b/src/main.cpp index 39eb657..171705e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,6 +35,9 @@ void OpenLyricsVersion::get_about_message(pfc::string_base & out) out += "You can support development at https://www.buymeacoffee.com/jacquesheunis\n"; out += "\nChangelog:\n"; // out += "Version " OPENLYRICS_VERSION " (" __DATE__ "):\n" + out += "Version 1.10.1 (2024-08-30):\n" + "- Fix version 1.10 not having any version at all in the fb2k components UI\n" + "\n"; out += "Version 1.10 (2024-08-30):\n" "- Add a source for LRCLIB (https://lrclib.net)\n" "- Add a source for SongLyrics.com\n"