From 3d7301dc7d061d2500491f11ca73e5f43890ecf5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 10 Oct 2025 10:58:25 +0000 Subject: [PATCH 1/6] Initial plan From 58f1c05402da0f8c972e04b4e20936d079f8fcf1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 10 Oct 2025 11:04:36 +0000 Subject: [PATCH 2/6] Add NuGet package configuration and release workflows Co-authored-by: lukaskabrt <2894161+lukaskabrt@users.noreply.github.com> --- .github/workflows/pr-validation.yml | 9 ++ .github/workflows/release.yml | 48 +++++++++ CHANGELOG.md | 22 ++++ LICENSE | 21 ++++ README.md | 18 +++- RELEASING.md | 152 ++++++++++++++++++++++++++++ src/PbfLite/PbfLite.csproj | 17 ++++ 7 files changed, 286 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md create mode 100644 LICENSE create mode 100644 RELEASING.md diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 849936f..aced6d7 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -25,3 +25,12 @@ jobs: - name: Run tests run: dotnet test src/PbfLite.slnx --no-build --configuration Release --verbosity normal + + - name: Pack NuGet package + run: dotnet pack src/PbfLite/PbfLite.csproj --no-build --configuration Release --output ./nupkg + + - name: Upload NuGet package artifact + uses: actions/upload-artifact@v4 + with: + name: nuget-package + path: ./nupkg/*.nupkg diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..97fb06b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Release + +on: + push: + tags: + - 'v*.*.*' + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + + - name: Restore dependencies + run: dotnet restore src/PbfLite.slnx + + - name: Build solution + run: dotnet build src/PbfLite.slnx --no-restore --configuration Release + + - name: Run tests + run: dotnet test src/PbfLite.slnx --no-build --configuration Release --verbosity normal + + - name: Pack NuGet package + run: dotnet pack src/PbfLite/PbfLite.csproj --no-build --configuration Release --output ./nupkg + + - name: Push to NuGet + run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate + + - name: Upload NuGet package artifact + uses: actions/upload-artifact@v4 + with: + name: nuget-package + path: ./nupkg/*.nupkg + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + files: ./nupkg/*.nupkg + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ccca428 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [1.0.0] - TBD + +### Added +- Initial release of PbfLite +- `PbfBlockReader` for reading Protocol Buffers +- `PbfBlockWriter` for writing Protocol Buffers +- Support for all Protocol Buffers wire types +- Manual control over serialization/deserialization +- No reflection overhead +- .NET 8.0 support + +[Unreleased]: https://github.com/lukaskabrt/PbfLITE/compare/v1.0.0...HEAD +[1.0.0]: https://github.com/lukaskabrt/PbfLITE/releases/tag/v1.0.0 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5cd96b7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Lukas Kabrt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 68199c3..fdb646e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,23 @@ PbfLITE is a low-level .NET Protocol Buffers implementation. It is intended for ## Getting Started -Add a reference to the `PbfLite` project and start using `PbfBlockReader` and `PbfBlockWriter` for manual protobuf serialization and deserialization. +### Installation + +Install PbfLite via NuGet: + +```bash +dotnet add package PbfLite +``` + +Or via the NuGet Package Manager: + +``` +Install-Package PbfLite +``` + +### Usage + +Start using `PbfBlockReader` and `PbfBlockWriter` for manual protobuf serialization and deserialization. ## Example: Deserializing an AddressBook diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..9d24fee --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,152 @@ +# Release Process + +This document describes how to create a new release of PbfLite. + +## Prerequisites + +1. Ensure all tests pass +2. Update CHANGELOG.md with release notes +3. Update version in `src/PbfLite/PbfLite.csproj` +4. Ensure you have NuGet API key configured as GitHub secret (`NUGET_API_KEY`) + +## Versioning Strategy + +PbfLite follows [Semantic Versioning](https://semver.org/): + +- **MAJOR** version: incompatible API changes +- **MINOR** version: new functionality in a backward-compatible manner +- **PATCH** version: backward-compatible bug fixes + +Version is manually updated in `src/PbfLite/PbfLite.csproj` in the `` property. + +## Release Steps + +### 1. Prepare the Release + +1. Create a new branch for the release: + ```bash + git checkout -b release/vX.Y.Z + ``` + +2. Update the version in `src/PbfLite/PbfLite.csproj`: + ```xml + X.Y.Z + ``` + +3. Update `CHANGELOG.md`: + - Move items from `[Unreleased]` to a new `[X.Y.Z]` section + - Add the release date + - Update the comparison links at the bottom + +4. Commit the changes: + ```bash + git add src/PbfLite/PbfLite.csproj CHANGELOG.md + git commit -m "Prepare release vX.Y.Z" + ``` + +5. Push the branch and create a Pull Request: + ```bash + git push origin release/vX.Y.Z + ``` + +6. Wait for PR validation to pass and get approval + +7. Merge the PR to master + +### 2. Create and Push the Release Tag + +1. After the PR is merged, checkout and update master: + ```bash + git checkout master + git pull origin master + ``` + +2. Create an annotated tag: + ```bash + git tag -a vX.Y.Z -m "Release version X.Y.Z" + ``` + +3. Push the tag to GitHub: + ```bash + git push origin vX.Y.Z + ``` + +### 3. Automated Release Process + +Once the tag is pushed, the release workflow (`.github/workflows/release.yml`) will automatically: + +1. Build the project in Release configuration +2. Run all tests +3. Pack the NuGet package +4. Publish to NuGet.org +5. Create a GitHub Release with the package attached + +### 4. Verify the Release + +1. Check the GitHub Actions workflow run to ensure it completed successfully +2. Verify the package appears on NuGet.org: https://www.nuget.org/packages/PbfLite/ +3. Check the GitHub Releases page: https://github.com/lukaskabrt/PbfLITE/releases + +## Tag Naming Convention + +Tags must follow the format `vX.Y.Z` where: +- `v` is a literal prefix +- `X.Y.Z` is the semantic version number + +Examples: +- `v1.0.0` - Initial release +- `v1.1.0` - Minor version with new features +- `v1.1.1` - Patch version with bug fixes +- `v2.0.0` - Major version with breaking changes + +## Release Notes Template + +When updating CHANGELOG.md, use the following structure: + +```markdown +## [X.Y.Z] - YYYY-MM-DD + +### Added +- New features + +### Changed +- Changes to existing functionality + +### Deprecated +- Features that will be removed in upcoming releases + +### Removed +- Removed features + +### Fixed +- Bug fixes + +### Security +- Security fixes +``` + +## NuGet API Key Setup + +The NuGet API key must be configured as a GitHub secret: + +1. Go to https://www.nuget.org/account/apikeys +2. Create a new API key with push permissions for PbfLite +3. In GitHub repository settings, go to Secrets and Variables → Actions +4. Create a new secret named `NUGET_API_KEY` with the API key value + +## Troubleshooting + +### Release workflow fails at NuGet push +- Verify the NUGET_API_KEY secret is correctly set +- Check if the version already exists on NuGet.org +- Ensure the API key has push permissions + +### Package validation errors +- Run `dotnet pack` locally to validate the package +- Check that all required metadata is present in the .csproj file +- Verify README.md and LICENSE files are included + +### Tests fail during release +- Ensure all tests pass locally before creating the tag +- Check if there are environment-specific test failures +- Review the workflow logs for details diff --git a/src/PbfLite/PbfLite.csproj b/src/PbfLite/PbfLite.csproj index 954372c..804b7a0 100644 --- a/src/PbfLite/PbfLite.csproj +++ b/src/PbfLite/PbfLite.csproj @@ -2,6 +2,19 @@ net8.0 + + + PbfLite + 1.0.0 + Lukas Kabrt + PbfLITE is a low-level .NET Protocol Buffers implementation. It is intended for scenarios where you need fine-grained control over serialization and deserialization without the overhead of reflection, but it requires developers to manually implement the serialization / deserialization logic. + MIT + https://github.com/lukaskabrt/PbfLITE + https://github.com/lukaskabrt/PbfLITE + git + protobuf;protocol-buffers;serialization;performance;low-level + README.md + false @@ -14,4 +27,8 @@ true + + + + From e88927d5f7463867aea229db2bc811ab5e70b93b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 10 Oct 2025 11:07:14 +0000 Subject: [PATCH 3/6] Add .gitignore for nupkg and NuGet setup documentation Co-authored-by: lukaskabrt <2894161+lukaskabrt@users.noreply.github.com> --- .github/NUGET_SETUP.md | 93 ++++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 94 insertions(+) create mode 100644 .github/NUGET_SETUP.md diff --git a/.github/NUGET_SETUP.md b/.github/NUGET_SETUP.md new file mode 100644 index 0000000..a117abf --- /dev/null +++ b/.github/NUGET_SETUP.md @@ -0,0 +1,93 @@ +# NuGet Package Publishing Setup + +This document describes the one-time setup required to enable automated NuGet package publishing. + +## Required Setup + +### 1. Create a NuGet.org Account + +If you don't already have one: + +1. Go to https://www.nuget.org/ +2. Sign up for a free account +3. Verify your email address + +### 2. Generate a NuGet API Key + +1. Sign in to https://www.nuget.org/ +2. Go to your account settings: https://www.nuget.org/account/apikeys +3. Click "Create" +4. Configure the API key: + - **Key Name**: `PbfLite-GitHub-Actions` (or any descriptive name) + - **Expiration**: Choose an appropriate expiration date (e.g., 365 days) + - **Select Scopes**: Choose "Push" and "Push new packages and package versions" + - **Select Packages**: Choose "Glob Pattern" + - **Glob Pattern**: Enter `PbfLite*` to restrict to PbfLite packages only +5. Click "Create" +6. **Important**: Copy the generated API key immediately - it will only be shown once! + +### 3. Add API Key to GitHub Secrets + +1. Go to your GitHub repository: https://github.com/lukaskabrt/PbfLITE +2. Navigate to Settings → Secrets and variables → Actions +3. Click "New repository secret" +4. Configure the secret: + - **Name**: `NUGET_API_KEY` (must match exactly) + - **Value**: Paste the API key you copied from NuGet.org +5. Click "Add secret" + +### 4. Verify the Setup + +Once the API key is configured: + +1. The release workflow will be able to publish packages automatically +2. Test the workflow by creating a test tag (you can delete it after): + ```bash + git tag -a v0.0.1-test -m "Test release workflow" + git push origin v0.0.1-test + ``` +3. Check the Actions tab to see if the workflow runs successfully +4. If successful, delete the test tag and package: + ```bash + git tag -d v0.0.1-test + git push origin :refs/tags/v0.0.1-test + ``` + And unlist the test package on NuGet.org + +## Security Best Practices + +- **Never commit the API key**: The key should only be stored in GitHub Secrets +- **Use appropriate expiration**: Set a reasonable expiration date for the API key +- **Limit scope**: The API key should only have push permissions for the PbfLite package +- **Rotate regularly**: Create a new API key before the old one expires +- **Monitor usage**: Check NuGet.org for unexpected package versions + +## Troubleshooting + +### Package push fails with 403 Forbidden +- Verify the NUGET_API_KEY secret is correctly set in GitHub +- Check if the API key has expired on NuGet.org +- Ensure the API key has push permissions for the package + +### Package push fails with 409 Conflict +- The version already exists on NuGet.org +- Update the version in `src/PbfLite/PbfLite.csproj` +- Create a new tag with the updated version + +### Cannot find NUGET_API_KEY secret +- Ensure the secret name is exactly `NUGET_API_KEY` (case-sensitive) +- Verify you have the necessary permissions to create secrets in the repository +- Check that the secret is created in the correct repository + +## Support + +For issues with: +- **NuGet.org account or API keys**: Contact NuGet.org support +- **GitHub Secrets**: Contact GitHub support or check repository settings +- **Release workflow**: Check the Actions tab for detailed error logs + +## Additional Resources + +- [NuGet API Keys Documentation](https://docs.microsoft.com/en-us/nuget/nuget-org/publish-a-package#managing-api-keys) +- [GitHub Secrets Documentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets) +- [PbfLite Release Process](../RELEASING.md) diff --git a/.gitignore b/.gitignore index 31977c7..850d209 100644 --- a/.gitignore +++ b/.gitignore @@ -160,6 +160,7 @@ PublishScripts/ # NuGet Packages *.nupkg +nupkg/ # The packages folder can be ignored because of Package Restore **/packages/* # except build/, which is used as an MSBuild target. From 49a4dc0bd386dfd1ab24ce1a51da1dd0a5f6194b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 10 Oct 2025 11:08:30 +0000 Subject: [PATCH 4/6] Add quick start guide for NuGet package setup Co-authored-by: lukaskabrt <2894161+lukaskabrt@users.noreply.github.com> --- .github/QUICK_START.md | 91 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/QUICK_START.md diff --git a/.github/QUICK_START.md b/.github/QUICK_START.md new file mode 100644 index 0000000..5da465b --- /dev/null +++ b/.github/QUICK_START.md @@ -0,0 +1,91 @@ +# Quick Start Guide for PbfLite NuGet Package + +## What Was Set Up + +This PR configures PbfLite for automated NuGet package publishing. Here's what's ready to go: + +### ✅ Completed Automatically +- **NuGet Package Metadata**: Version 1.0.0, MIT License, full description +- **LICENSE file**: MIT License added to repository +- **CHANGELOG.md**: Ready for tracking version history +- **README.md**: Updated with NuGet installation instructions +- **Release Workflow**: Automated GitHub Actions workflow for releases +- **PR Validation**: Updated to validate package builds on every PR + +### 🔧 Required Manual Setup (One-Time) + +**You need to configure the NuGet API key in GitHub Secrets** + +Quick steps: +1. Go to https://www.nuget.org/account/apikeys +2. Create an API key with push permissions for PbfLite +3. Copy the key (shown only once!) +4. Go to GitHub repository Settings → Secrets → Actions +5. Create secret named `NUGET_API_KEY` with the key value + +📖 **Detailed instructions**: See `.github/NUGET_SETUP.md` + +## How to Create Your First Release + +Once the API key is configured: + +```bash +# 1. Update version in src/PbfLite/PbfLite.csproj +# 2. Update CHANGELOG.md with release notes +# 3. Commit changes +git add src/PbfLite/PbfLite.csproj CHANGELOG.md +git commit -m "Prepare release v1.0.0" +git push + +# 4. Create and push a tag +git tag -a v1.0.0 -m "Release version 1.0.0" +git push origin v1.0.0 +``` + +The release workflow will automatically: +- ✅ Build the project +- ✅ Run all tests +- ✅ Create NuGet package +- ✅ Publish to NuGet.org +- ✅ Create GitHub Release + +📖 **Full release process**: See `RELEASING.md` + +## Testing the Setup + +To verify everything works without publishing: + +```bash +# Build and pack locally +dotnet build src/PbfLite.slnx --configuration Release +dotnet pack src/PbfLite/PbfLite.csproj --configuration Release --output ./test-nupkg + +# Check the package +ls -lh ./test-nupkg/ +unzip -l ./test-nupkg/PbfLite.1.0.0.nupkg + +# Clean up +rm -rf ./test-nupkg/ +``` + +## Package Information + +- **Package ID**: `PbfLite` +- **Initial Version**: `1.0.0` +- **Target Framework**: .NET 8.0 +- **License**: MIT +- **Repository**: https://github.com/lukaskabrt/PbfLITE + +## Support & Documentation + +- **NuGet Setup**: `.github/NUGET_SETUP.md` +- **Release Process**: `RELEASING.md` +- **Version History**: `CHANGELOG.md` +- **Workflows**: `.github/workflows/` + +## Questions? + +If you have questions about: +- Setting up NuGet API key → See `.github/NUGET_SETUP.md` +- Creating releases → See `RELEASING.md` +- Package metadata → Check `src/PbfLite/PbfLite.csproj` From 1d1dea5339d32765e2fc49fe764d207f626e9405 Mon Sep 17 00:00:00 2001 From: Lukas Kabrt Date: Fri, 10 Oct 2025 13:56:47 +0200 Subject: [PATCH 5/6] Refactor NuGet setup documentation and workflows for improved clarity and efficiency --- .github/NUGET_SETUP.md | 60 ------------------- .github/QUICK_START.md | 91 ----------------------------- .github/workflows/pr-validation.yml | 6 -- .github/workflows/release.yml | 16 +---- CHANGELOG.md | 12 +--- RELEASING.md | 48 +-------------- src/PbfLite/PbfLite.csproj | 2 +- 7 files changed, 6 insertions(+), 229 deletions(-) delete mode 100644 .github/QUICK_START.md diff --git a/.github/NUGET_SETUP.md b/.github/NUGET_SETUP.md index a117abf..0f70d26 100644 --- a/.github/NUGET_SETUP.md +++ b/.github/NUGET_SETUP.md @@ -6,25 +6,15 @@ This document describes the one-time setup required to enable automated NuGet pa ### 1. Create a NuGet.org Account -If you don't already have one: - -1. Go to https://www.nuget.org/ -2. Sign up for a free account -3. Verify your email address - ### 2. Generate a NuGet API Key 1. Sign in to https://www.nuget.org/ 2. Go to your account settings: https://www.nuget.org/account/apikeys 3. Click "Create" 4. Configure the API key: - - **Key Name**: `PbfLite-GitHub-Actions` (or any descriptive name) - - **Expiration**: Choose an appropriate expiration date (e.g., 365 days) - - **Select Scopes**: Choose "Push" and "Push new packages and package versions" - **Select Packages**: Choose "Glob Pattern" - **Glob Pattern**: Enter `PbfLite*` to restrict to PbfLite packages only 5. Click "Create" -6. **Important**: Copy the generated API key immediately - it will only be shown once! ### 3. Add API Key to GitHub Secrets @@ -36,56 +26,6 @@ If you don't already have one: - **Value**: Paste the API key you copied from NuGet.org 5. Click "Add secret" -### 4. Verify the Setup - -Once the API key is configured: - -1. The release workflow will be able to publish packages automatically -2. Test the workflow by creating a test tag (you can delete it after): - ```bash - git tag -a v0.0.1-test -m "Test release workflow" - git push origin v0.0.1-test - ``` -3. Check the Actions tab to see if the workflow runs successfully -4. If successful, delete the test tag and package: - ```bash - git tag -d v0.0.1-test - git push origin :refs/tags/v0.0.1-test - ``` - And unlist the test package on NuGet.org - -## Security Best Practices - -- **Never commit the API key**: The key should only be stored in GitHub Secrets -- **Use appropriate expiration**: Set a reasonable expiration date for the API key -- **Limit scope**: The API key should only have push permissions for the PbfLite package -- **Rotate regularly**: Create a new API key before the old one expires -- **Monitor usage**: Check NuGet.org for unexpected package versions - -## Troubleshooting - -### Package push fails with 403 Forbidden -- Verify the NUGET_API_KEY secret is correctly set in GitHub -- Check if the API key has expired on NuGet.org -- Ensure the API key has push permissions for the package - -### Package push fails with 409 Conflict -- The version already exists on NuGet.org -- Update the version in `src/PbfLite/PbfLite.csproj` -- Create a new tag with the updated version - -### Cannot find NUGET_API_KEY secret -- Ensure the secret name is exactly `NUGET_API_KEY` (case-sensitive) -- Verify you have the necessary permissions to create secrets in the repository -- Check that the secret is created in the correct repository - -## Support - -For issues with: -- **NuGet.org account or API keys**: Contact NuGet.org support -- **GitHub Secrets**: Contact GitHub support or check repository settings -- **Release workflow**: Check the Actions tab for detailed error logs - ## Additional Resources - [NuGet API Keys Documentation](https://docs.microsoft.com/en-us/nuget/nuget-org/publish-a-package#managing-api-keys) diff --git a/.github/QUICK_START.md b/.github/QUICK_START.md deleted file mode 100644 index 5da465b..0000000 --- a/.github/QUICK_START.md +++ /dev/null @@ -1,91 +0,0 @@ -# Quick Start Guide for PbfLite NuGet Package - -## What Was Set Up - -This PR configures PbfLite for automated NuGet package publishing. Here's what's ready to go: - -### ✅ Completed Automatically -- **NuGet Package Metadata**: Version 1.0.0, MIT License, full description -- **LICENSE file**: MIT License added to repository -- **CHANGELOG.md**: Ready for tracking version history -- **README.md**: Updated with NuGet installation instructions -- **Release Workflow**: Automated GitHub Actions workflow for releases -- **PR Validation**: Updated to validate package builds on every PR - -### 🔧 Required Manual Setup (One-Time) - -**You need to configure the NuGet API key in GitHub Secrets** - -Quick steps: -1. Go to https://www.nuget.org/account/apikeys -2. Create an API key with push permissions for PbfLite -3. Copy the key (shown only once!) -4. Go to GitHub repository Settings → Secrets → Actions -5. Create secret named `NUGET_API_KEY` with the key value - -📖 **Detailed instructions**: See `.github/NUGET_SETUP.md` - -## How to Create Your First Release - -Once the API key is configured: - -```bash -# 1. Update version in src/PbfLite/PbfLite.csproj -# 2. Update CHANGELOG.md with release notes -# 3. Commit changes -git add src/PbfLite/PbfLite.csproj CHANGELOG.md -git commit -m "Prepare release v1.0.0" -git push - -# 4. Create and push a tag -git tag -a v1.0.0 -m "Release version 1.0.0" -git push origin v1.0.0 -``` - -The release workflow will automatically: -- ✅ Build the project -- ✅ Run all tests -- ✅ Create NuGet package -- ✅ Publish to NuGet.org -- ✅ Create GitHub Release - -📖 **Full release process**: See `RELEASING.md` - -## Testing the Setup - -To verify everything works without publishing: - -```bash -# Build and pack locally -dotnet build src/PbfLite.slnx --configuration Release -dotnet pack src/PbfLite/PbfLite.csproj --configuration Release --output ./test-nupkg - -# Check the package -ls -lh ./test-nupkg/ -unzip -l ./test-nupkg/PbfLite.1.0.0.nupkg - -# Clean up -rm -rf ./test-nupkg/ -``` - -## Package Information - -- **Package ID**: `PbfLite` -- **Initial Version**: `1.0.0` -- **Target Framework**: .NET 8.0 -- **License**: MIT -- **Repository**: https://github.com/lukaskabrt/PbfLITE - -## Support & Documentation - -- **NuGet Setup**: `.github/NUGET_SETUP.md` -- **Release Process**: `RELEASING.md` -- **Version History**: `CHANGELOG.md` -- **Workflows**: `.github/workflows/` - -## Questions? - -If you have questions about: -- Setting up NuGet API key → See `.github/NUGET_SETUP.md` -- Creating releases → See `RELEASING.md` -- Package metadata → Check `src/PbfLite/PbfLite.csproj` diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index aced6d7..5719ae8 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -28,9 +28,3 @@ jobs: - name: Pack NuGet package run: dotnet pack src/PbfLite/PbfLite.csproj --no-build --configuration Release --output ./nupkg - - - name: Upload NuGet package artifact - uses: actions/upload-artifact@v4 - with: - name: nuget-package - path: ./nupkg/*.nupkg diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97fb06b..18ddecb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,18 +31,4 @@ jobs: run: dotnet pack src/PbfLite/PbfLite.csproj --no-build --configuration Release --output ./nupkg - name: Push to NuGet - run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate - - - name: Upload NuGet package artifact - uses: actions/upload-artifact@v4 - with: - name: nuget-package - path: ./nupkg/*.nupkg - - - name: Create GitHub Release - uses: softprops/action-gh-release@v1 - with: - files: ./nupkg/*.nupkg - generate_release_notes: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ccca428..fe8592a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,16 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [1.0.0] - TBD +## [0.1.0] - TBD ### Added - Initial release of PbfLite -- `PbfBlockReader` for reading Protocol Buffers -- `PbfBlockWriter` for writing Protocol Buffers -- Support for all Protocol Buffers wire types -- Manual control over serialization/deserialization -- No reflection overhead -- .NET 8.0 support -[Unreleased]: https://github.com/lukaskabrt/PbfLITE/compare/v1.0.0...HEAD -[1.0.0]: https://github.com/lukaskabrt/PbfLITE/releases/tag/v1.0.0 +[Unreleased]: https://github.com/lukaskabrt/PbfLITE/compare/v0.1.0...HEAD +[0.1.0]: https://github.com/lukaskabrt/PbfLITE/releases/tag/v0.1.0 diff --git a/RELEASING.md b/RELEASING.md index 9d24fee..197ac46 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -2,13 +2,6 @@ This document describes how to create a new release of PbfLite. -## Prerequisites - -1. Ensure all tests pass -2. Update CHANGELOG.md with release notes -3. Update version in `src/PbfLite/PbfLite.csproj` -4. Ensure you have NuGet API key configured as GitHub secret (`NUGET_API_KEY`) - ## Versioning Strategy PbfLite follows [Semantic Versioning](https://semver.org/): @@ -79,13 +72,6 @@ Once the tag is pushed, the release workflow (`.github/workflows/release.yml`) w 2. Run all tests 3. Pack the NuGet package 4. Publish to NuGet.org -5. Create a GitHub Release with the package attached - -### 4. Verify the Release - -1. Check the GitHub Actions workflow run to ensure it completed successfully -2. Verify the package appears on NuGet.org: https://www.nuget.org/packages/PbfLite/ -3. Check the GitHub Releases page: https://github.com/lukaskabrt/PbfLITE/releases ## Tag Naming Convention @@ -93,12 +79,6 @@ Tags must follow the format `vX.Y.Z` where: - `v` is a literal prefix - `X.Y.Z` is the semantic version number -Examples: -- `v1.0.0` - Initial release -- `v1.1.0` - Minor version with new features -- `v1.1.1` - Patch version with bug fixes -- `v2.0.0` - Major version with breaking changes - ## Release Notes Template When updating CHANGELOG.md, use the following structure: @@ -123,30 +103,4 @@ When updating CHANGELOG.md, use the following structure: ### Security - Security fixes -``` - -## NuGet API Key Setup - -The NuGet API key must be configured as a GitHub secret: - -1. Go to https://www.nuget.org/account/apikeys -2. Create a new API key with push permissions for PbfLite -3. In GitHub repository settings, go to Secrets and Variables → Actions -4. Create a new secret named `NUGET_API_KEY` with the API key value - -## Troubleshooting - -### Release workflow fails at NuGet push -- Verify the NUGET_API_KEY secret is correctly set -- Check if the version already exists on NuGet.org -- Ensure the API key has push permissions - -### Package validation errors -- Run `dotnet pack` locally to validate the package -- Check that all required metadata is present in the .csproj file -- Verify README.md and LICENSE files are included - -### Tests fail during release -- Ensure all tests pass locally before creating the tag -- Check if there are environment-specific test failures -- Review the workflow logs for details +``` \ No newline at end of file diff --git a/src/PbfLite/PbfLite.csproj b/src/PbfLite/PbfLite.csproj index 804b7a0..619736e 100644 --- a/src/PbfLite/PbfLite.csproj +++ b/src/PbfLite/PbfLite.csproj @@ -12,7 +12,7 @@ https://github.com/lukaskabrt/PbfLITE https://github.com/lukaskabrt/PbfLITE git - protobuf;protocol-buffers;serialization;performance;low-level + protobuf;protocol-buffers;serialization README.md false From 2ac19ca5ec6f6ffc02b0a8d29cb195507b863b2c Mon Sep 17 00:00:00 2001 From: Lukas Kabrt Date: Fri, 10 Oct 2025 14:02:59 +0200 Subject: [PATCH 6/6] Pre release version --- src/PbfLite/PbfLite.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PbfLite/PbfLite.csproj b/src/PbfLite/PbfLite.csproj index 619736e..8ea251a 100644 --- a/src/PbfLite/PbfLite.csproj +++ b/src/PbfLite/PbfLite.csproj @@ -5,7 +5,7 @@ PbfLite - 1.0.0 + 0.1.0 Lukas Kabrt PbfLITE is a low-level .NET Protocol Buffers implementation. It is intended for scenarios where you need fine-grained control over serialization and deserialization without the overhead of reflection, but it requires developers to manually implement the serialization / deserialization logic. MIT