diff --git a/.github/workflows/NUGET_RELEASE.md b/.github/workflows/NUGET_RELEASE.md index f19a662a..bff4c37f 100644 --- a/.github/workflows/NUGET_RELEASE.md +++ b/.github/workflows/NUGET_RELEASE.md @@ -21,8 +21,8 @@ The workflow automatically determines the version based on whether the commit is 2. **Untagged Release (Prerelease)**: - If the current commit is NOT tagged - Creates a prerelease version based on the last tag - - Format: `{LAST_TAG}-preview.{COMMIT_COUNT}+{SHORT_SHA}` - - Example: `0.42.1-preview.123+abc1234` + - Format: `{LAST_TAG}-preview.{COMMIT_COUNT}` + - Example: `0.42.1-preview.123` - Published as a prerelease to NuGet.org ### Workflow Steps @@ -81,7 +81,7 @@ Consider enabling branch protection rules for the `release` branch to ensure: ``` 2. The workflow will automatically: - Build and test the project - - Publish a prerelease version like `0.42.1-preview.456+abc1234` to NuGet.org + - Publish a prerelease version like `0.42.1-preview.456` to NuGet.org ## Troubleshooting diff --git a/.github/workflows/TESTING.md b/.github/workflows/TESTING.md index cc035a12..6168e99e 100644 --- a/.github/workflows/TESTING.md +++ b/.github/workflows/TESTING.md @@ -26,7 +26,7 @@ This tests the workflow on untagged commits to the release branch. 4. Monitor the GitHub Actions workflow at: https://github.com/adamhathcock/sharpcompress/actions 5. Verify: - Workflow triggers and runs successfully - - Version is determined correctly (e.g., `0.42.1-preview.XXX+XXXXXXX`) + - Version is determined correctly (e.g., `0.42.1-preview.XXX`) - Build and tests pass - Package is uploaded as artifact - Package is pushed to NuGet.org as prerelease @@ -34,7 +34,7 @@ This tests the workflow on untagged commits to the release branch. **Expected Outcome:** - A new prerelease package appears on NuGet.org: https://www.nuget.org/packages/SharpCompress/ -- Package version follows pattern: `{LAST_TAG}-preview.{COMMIT_COUNT}+{SHA}` +- Package version follows pattern: `{LAST_TAG}-preview.{COMMIT_COUNT}` ### 2. Test Tagged Release Publishing diff --git a/build/Program.cs b/build/Program.cs index f6819af8..dc8c11f3 100644 --- a/build/Program.cs +++ b/build/Program.cs @@ -290,9 +290,8 @@ static (string version, bool isPrerelease) GetVersion() var lastTag = allTags.OrderBy(tag => Version.Parse(tag)).LastOrDefault() ?? "0.0.0"; var commitCount = GetGitOutput("rev-list", "--count HEAD").Trim(); - var commitSha = GetGitOutput("rev-parse", "--short HEAD").Trim(); - var version = $"{lastTag}-preview.{commitCount}+{commitSha}"; + var version = $"{lastTag}-preview.{commitCount}"; Console.WriteLine($"Building prerelease version: {version}"); return (version, true); }