mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-13 21:22:22 +00:00
- Removed create-release build target from build/Program.cs - Removed CreateRelease constant - Removed "Create GitHub Release" step from workflow - Removed permissions: contents: write since no longer creating releases - Updated NUGET_RELEASE.md to remove all references to GitHub release creation - Updated TESTING.md to remove GitHub release verification steps - GitHub releases will now be created manually instead of automatically Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
4.0 KiB
4.0 KiB
Testing Guide for NuGet Release Workflow
This document describes how to test the NuGet release workflow.
Testing Strategy
Since this workflow publishes to NuGet.org and requires repository secrets, testing should be done carefully. The workflow runs on both Windows and Ubuntu, but only the Windows build publishes to NuGet.
Pre-Testing Checklist
- Workflow YAML syntax validated
- Version determination logic tested locally
- Version update logic tested locally
- Build script works (
dotnet run --project build/build.csproj)
Manual Testing Steps
1. Test Prerelease Publishing (Recommended First Test)
This tests the workflow on untagged commits to the master or release branch.
Steps:
- Ensure
NUGET_API_KEYsecret is configured in repository settings - Create a test commit on the
masterorreleasebranch (e.g., update a comment or README) - Push to the
masterorreleasebranch - Monitor the GitHub Actions workflow at: https://github.com/adamhathcock/sharpcompress/actions
- Verify:
- Workflow triggers and runs successfully on both Windows and Ubuntu
- Version is determined correctly (e.g.,
0.43.0-beta.XXXif last tag is 0.42.x) - Build and tests pass on both platforms
- Package artifacts are uploaded for both platforms
- Package is pushed to NuGet.org as prerelease (Windows build only)
Expected Outcome:
- A new prerelease package appears on NuGet.org: https://www.nuget.org/packages/SharpCompress/
- Package version follows pattern:
{NEXT_MINOR_VERSION}-beta.{COMMIT_COUNT}
2. Test Tagged Release Publishing
This tests the workflow when a version tag is pushed.
Steps:
- Prepare the
masterorreleasebranch with all desired changes - Create a version tag (must be a pure semantic version like
MAJOR.MINOR.PATCH):git checkout master # or release git tag 0.42.2 git push origin 0.42.2 - Monitor the GitHub Actions workflow
- Verify:
- Workflow triggers and runs successfully on both Windows and Ubuntu
- Version is determined as the tag (e.g.,
0.42.2) - Build and tests pass on both platforms
- Package artifacts are uploaded for both platforms
- Package is pushed to NuGet.org as stable release (Windows build only)
Expected Outcome:
- A new stable release package appears on NuGet.org
- Package version matches the tag
3. Test Duplicate Package Handling
This tests the --skip-duplicate flag behavior.
Steps:
- Push to the
releasebranch without making changes - Monitor the workflow
- Verify:
- Workflow runs but NuGet push is skipped with "duplicate" message
- No errors occur
4. Test Build Failure Handling
This tests that failed builds don't publish packages.
Steps:
- Introduce a breaking change in a test or code
- Push to the
releasebranch - Verify:
- Workflow runs and detects the failure
- Build or test step fails
- NuGet push step is skipped
- No package is published
Verification
After each test, verify:
- GitHub Actions Logs: Check the workflow logs for any errors or warnings
- NuGet.org: Verify the package appears with correct version and metadata
- Artifacts: Download and inspect the uploaded artifacts
Rollback/Cleanup
If testing produces unwanted packages:
- Prerelease packages: Can be unlisted on NuGet.org (Settings → Unlist)
- Stable packages: Cannot be deleted, only unlisted (use test versions)
- Tags: Can be deleted with:
git tag -d 0.42.2 git push origin :refs/tags/0.42.2
Known Limitations
- NuGet.org does not allow re-uploading the same version
- Deleted packages on NuGet.org reserve the version number
- The workflow requires the
NUGET_API_KEYsecret to be set
Success Criteria
The workflow is considered successful if:
- ✅ Prerelease versions are published correctly with beta suffix
- ✅ Tagged versions are published as stable releases
- ✅ Build and test failures prevent publishing
- ✅ Duplicate packages are handled gracefully
- ✅ Workflow logs are clear and informative