Skip to content

Commit

Permalink
Merge pull request #98 from Lordfirespeed/actions-housekeeping
Browse files Browse the repository at this point in the history
Strip build metadata from the software version
  • Loading branch information
MythicManiac committed Dec 10, 2023
2 parents a8ddfb0 + f54eaba commit 10b73c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
name: "Thunderstore CLI ${{ needs.validate-tag.outputs.tag }}"
body_path: ${{ github.workspace }}/.github/RELEASE_TEMPLATE.md
draft: true
prerelease: ${{ startsWith(steps.tag.outputs.tag, '0.') }}
prerelease: ${{ startsWith(needs.validate-tag.outputs.tag, '0.') }}

nupkg:
name: Build NuGet Package
Expand Down Expand Up @@ -119,4 +119,4 @@ jobs:
name: "Thunderstore CLI ${{ needs.validate-tag.outputs.tag }}"
body_path: ${{ github.workspace }}/.github/RELEASE_TEMPLATE.md
draft: true
prerelease: ${{ startsWith(steps.tag.outputs.tag, '0.') }}
prerelease: ${{ startsWith(needs.validate-tag.outputs.tag, '0.') }}
4 changes: 2 additions & 2 deletions ThunderstoreCLI/Utils/MiscUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public static int[] GetCurrentVersion()
throw new Exception("Reading app version from assembly failed");
}

// Drop possible pre-release cruft ("-alpha.0.1") from the end.
var versionParts = version.Split('-')[0].Split('.');
// Drop possible pre-release or build metadata cruft ("-alpha.0.1", "+abcde") from the end.
var versionParts = version.Split('-', '+')[0].Split('.');

if (versionParts is null || versionParts.Length != 3)
{
Expand Down

0 comments on commit 10b73c8

Please sign in to comment.