mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-13 05:25:00 +00:00
[PR #1095] [MERGED] Add GitHub Actions workflow for automated NuGet releases with multi-platform builds #1522
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/1095
Author: @Copilot
Created: 1/1/2026
Status: ✅ Merged
Merged: 1/3/2026
Merged by: @adamhathcock
Base:
master← Head:copilot/add-github-action-nuget-release📝 Commits (10+)
24d651dInitial plan9001e28Add GitHub Actions workflow for NuGet releases2feabedRemove redundant NUGET_API_KEY environment variable2f874acAdd comment clarifying sort -V usage9238cf1Move bash logic to C# build targetsbcf7137Fix code review issues: use cross-platform git executioncaa82a6Remove duplicate entry in documentation7f71f76Remove SHA from prerelease version, use only commit countd5913e8Fix TESTING.md to use valid version tag format9d6cd93Use next minor version with beta suffix for prereleases📊 Changes
5 files changed (+497 additions, -0 deletions)
View changed files
➕
.github/workflows/NUGET_RELEASE.md(+155 -0)➕
.github/workflows/TESTING.md(+120 -0)➕
.github/workflows/nuget-release.yml(+57 -0)📝
.gitignore(+1 -0)📝
build/Program.cs(+164 -0)📄 Description
Implements automated NuGet publishing for the
masterandreleasebranches with automatic version detection and prerelease support. The workflow runs on both Windows and Ubuntu for comprehensive testing, with NuGet publishing only on Windows. All version detection, file updates, and publishing logic is implemented in C# in the build project. GitHub releases are created manually.Workflow Behavior
Version Detection (C# implementation):
{NEXT_MINOR_VERSION}-beta.{COMMIT_COUNT}Pipeline:
masterandreleasebranch pushesMAJOR.MINOR.PATCH)SharpCompress.csprojusing C# build targetNUGET_API_KEYsecret (Windows only)--skip-duplicatefor idempotencyImplementation
All logic is implemented in C# as build targets in
build/Program.cs:determine-version- Detects version from git tags, increments minor version for prereleases, and outputs to GitHub Actionsupdate-version- Updates VersionPrefix, AssemblyVersion, and FileVersion in project filepush-to-nuget- Publishes packages to NuGet.orgThe workflow calls these C# targets instead of using bash scripts. Cross-platform compatible (Windows/Linux). Matrix builds ensure cross-platform compatibility while keeping NuGet publishing exclusive to Windows to prevent duplicate publishes.
Example Usage
Setup Required
Add
NUGET_API_KEYsecret to repository settings with NuGet.org API key.Files Added/Modified
.github/workflows/nuget-release.yml- Multi-platform workflow with matrix strategy calling C# build targets, triggers on branch and tag pushes.github/workflows/NUGET_RELEASE.md- Setup and usage documentation with build targets info.github/workflows/TESTING.md- Testing proceduresbuild/Program.cs- Added 3 new build targets with version detection and publishing logic.gitignore- Addedartifacts/directoryOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.