The NuGet package version is automatically generated during the GitHub Actions build process. The version follows the pattern 1.6.XXX where XXX is the GitHub Actions run number, ensuring each build has a unique, incrementing version number.
Examples:
- Build run #100 → Version 1.6.100
- Build run #101 → Version 1.6.101
- Build run #150 → Version 1.6.150
The version is automatically updated in:
- Source/Common/GlobalAssemblyInfo.cs - Assembly version
- Nuget/WriteableBitmapEx.nuspec - NuGet package version
Note: You do NOT need to manually update version numbers in these files. The workflow handles this automatically.
A GitHub Actions workflow has been configured to automatically build, version, and publish the NuGet package using GitHub's cloud infrastructure (Windows runners).
Setup (One-time):
- Add your NuGet API key as a repository secret named
NUGET_API_KEY- Go to Settings → Secrets and variables → Actions → New repository secret
- Name:
NUGET_API_KEY - Value: Your NuGet.org API key
To build and publish:
- Go to the "Actions" tab in the GitHub repository
- Select the "Build and Pack NuGet" workflow
- Click "Run workflow" button
- The workflow will:
- Auto-generate version number (1.6.{run_number})
- Update version in GlobalAssemblyInfo.cs and WriteableBitmapEx.nuspec
- Build all platform-specific libraries
- Create the NuGet package
- Publish to NuGet.org automatically (if NUGET_API_KEY secret is configured)
- Upload package as artifact for manual download if needed
Alternative triggers:
- The workflow also runs automatically when you push a tag starting with 'v' (e.g.,
v1.6.100) - You can manually trigger it from the Actions tab
Benefits of this approach:
- Automatic version management - No manual version updates needed
- Unique version numbers - Each build gets a new version
- Automatic publishing - Direct push to NuGet.org
- No local Windows machine required
- Consistent build environment
- Works in GitHub Codespaces or any environment
If you prefer to build locally, you need a Windows machine with the following tools installed:
- Visual Studio 2017 or later
- .NET Framework 4.0 SDK
- .NET Core 3.0 SDK
Note: When building manually, you will need to manually manage version numbers in the files mentioned above.
- Build WPF Libraries
This will create the following outputs in
cd Solution dotnet build WriteableBitmapEx_All.sln -c Release /p:EnableWindowsTargeting=trueBuild\Release\:net40\WriteableBitmapEx.Wpf.dllnetcoreapp3.0\WriteableBitmapEx.Wpf.dll
Once all libraries are built and placed in the Build\Release\ directory:
-
Navigate to the Nuget folder:
cd Nuget -
Run the pack command:
pack.cmd
This will create
WriteableBitmapEx.1.6.11.nupkgin theBuild\nuget\directory.
Note: When using GitHub Actions (recommended), publishing is automatic. This section is only for manual builds.
-
Update the version in
Nuget/push.cmdto match your build -
Update the API key in
push.cmd(replace[APIKEY]with your actual NuGet API key) -
Run the push command:
push.cmd
Note: The push.cmd script currently tries to delete the old version, which may not be necessary or desired. You may want to comment out that line.
After publishing, verify the package at: https://www.nuget.org/packages/WriteableBitmapEx
The new version 1.6.11 should appear with the updated metadata.
✅ Automated version management - Version auto-increments with each build (1.6.{run_number}) ✅ Automatic NuGet publishing - Publishes to NuGet.org on every successful build ✅ No manual version updates needed - Workflow handles everything ✅ Copyright year updated to 2026 ✅ GitHub Actions workflow configured for cloud builds
Yes! This project fully works with GitHub Codespaces. While you cannot build the Windows-specific libraries directly in Codespaces (which runs on Linux), you can:
- Make code changes - Edit source files in Codespaces
- Trigger cloud builds - Use the GitHub Actions workflow to build on Windows runners with automatic versioning
- Review and manage releases - All from within Codespaces
The GitHub Actions workflow runs on windows-latest runners, which have all the necessary SDKs and tools pre-installed, making it possible to build and publish the complete NuGet package without needing a local Windows machine.