This guide explains how to publish the EtabSharp NuGet package and the CI/CD setup.
- GitHub repository with admin access
- NuGet.org account (create at https://www.nuget.org/users/account/LogOn)
- Go to https://www.nuget.org/account/apikeys
- Click Create to generate a new API key
- Give it a name like "EtabSharp-CI-CD" and set expiration (optional)
- Copy the generated key (you won't see it again)
- Go to your GitHub repository: https://github.com/tadodev/EtabSharp
- Navigate to Settings ? Secrets and variables ? Actions
- Click New repository secret
- Name:
NUGET_API_KEY - Value: Paste the API key from Step 1
- Click Add secret
The CI/CD pipeline is triggered when you create a Git tag in the format v* (e.g., v0.1.0-beta, v1.0.0).
For the first beta release:
git tag v0.1.0-beta
git push origin v0.1.0-betaFor future releases:
git tag v1.0.0
git push origin v1.0.0- Go to your repository's Releases page
- Click Draft a new release
- Tag version: Enter
v0.1.0-beta(for first release) orv1.0.0for stable versions - Release title: Enter
Release v0.1.0-beta - Check "Set as a pre-release" for beta/rc versions
- Add release notes describing changes
- Click Publish release
When you create a tag matching v*:
- ? GitHub Actions checks out your code
- ? Builds the project in Release mode
- ? Runs all tests
- ? Extracts version from tag
- ? Updates the project version in
.csproj - ? Packs the NuGet package
- ? Publishes to NuGet.org
- ? Creates a GitHub Release (marked as prerelease for beta versions)
- Go to your repository's Actions tab
- Select the Publish NuGet Package workflow
- Monitor the build progress in real-time
- View detailed logs if any step fails
v0.1.0-beta- Beta release (current)v0.1.0-rc.1- Release candidatev1.0.0- Major version 1.0 (stable)v1.0.1- Patch version (bug fixes)v1.1.0- Minor version (new features)v2.0.0- Major version (breaking changes)
The workflow automatically detects prerelease versions (containing -) and marks the GitHub release appropriately.
Update your package release notes in src/EtabSharp/EtabSharp.csproj before each release:
<PackageReleaseNotes>
v0.1.0-beta - Initial beta release
- Added feature X
- Fixed bug Y
</PackageReleaseNotes>The Tests workflow automatically runs on:
- Every push to
master,main, ordevelopbranches - Every pull request to these branches
This ensures code quality before merging or publishing.
# Build the project
dotnet build -c Release
# Run tests
dotnet test -c Release
# Pack the NuGet package
dotnet pack src/EtabSharp/EtabSharp.csproj -c Release -o ./nuget
# Verify the package (optional)
dotnet nuget locals all --list- Check the Actions tab for error logs
- Common issues:
- API key expired ? Generate a new one and update the secret
- Tests failed ? Fix the issues and push new code
- ETABSv1.dll not found ? This is expected in CI (mock it in tests)
- Check https://www.nuget.org/packages/EtabSharp/
- It may take a few minutes to appear after publishing
- Beta versions will show under "Pre-release versions"
- Verify via:
dotnet package search EtabSharp --prerelease
Once published, install the beta version:
dotnet add package EtabSharp --version 0.1.0-betaOr in .csproj:
<PackageReference Include="EtabSharp" Version="0.1.0-beta" />For future stable releases:
dotnet add package EtabSharp --version 1.0.0