Repository navigation
Adopt Nerdbank.GitVersioning #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <Project> | ||
| <ItemGroup> | ||
| <PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="all" /> | ||
| </ItemGroup> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,108 +1,116 @@ | ||
| # Systray Doom | ||
|
|
||
| ## Download | ||
|
|
||
| ```pwsh | ||
| # 1. Clone the repo | ||
| git clone https://github.com/citelao/systray-doom | ||
|
|
||
| # 2. Put DOOM1.WAD in the systray_doom/ directory (you can find the shareware free & legal online) | ||
| # cp somethingsomething | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| For usage of the systray library, see [the Systray README](./Systray/README.md). | ||
|
|
||
| > dotnet add package citelao.SystrayIcon | ||
|
|
||
| ## Dev | ||
|
|
||
| ```pwsh | ||
| # Build the Rust bindings | ||
| cd rust_bindings/ | ||
| cargo build | ||
|
|
||
| # Build & run the Dotnet! | ||
| cd .. | ||
| dotnet run --project .\systray_doom\systray_doom.csproj | ||
| ``` | ||
|
|
||
| ### Validating AOT compatibility | ||
|
|
||
| The Systray library is marked AOT-compatible, which *will* generate warnings for any issues in the library directly. However, that doesn't check its dependencies. To validate end-to-end: | ||
|
|
||
| ```pwsh | ||
| # Publish all the things! This verifies AOT-compatibility | ||
| # https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/prepare-libraries-for-trimming | ||
| dotnet publish -c Release | ||
| ``` | ||
|
|
||
| ### Publishing versions | ||
|
|
||
| Prerequisites (see above): | ||
|
|
||
| 1. Ensure it builds! | ||
| 2. Validate AOT compatibility | ||
|
|
||
| Then: | ||
|
|
||
| ```pwsh | ||
|
|
||
| # Get an API key | ||
| # (for initial push, use `*` glob pattern) | ||
| # https://www.nuget.org/account/apikeys | ||
| # https://int.nugettest.org/account/apikeys | ||
| $apiKey = # paste from the website | ||
|
|
||
| # Publish to main | ||
| git checkout main | ||
| git merge dev | ||
|
|
||
| # Bump the version | ||
| # In systray.csproj, bump `<Version>`. | ||
|
|
||
| # Update the CHANGELOG | ||
| # ... | ||
|
|
||
| # Create the nupkg | ||
| # https://learn.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli | ||
| dotnet build -c release | ||
| # => Systray\bin\Release\citelao.SystrayIcon.0.1.0.nupkg | ||
|
|
||
| ls Systray\bin\Release\*.nupkg | ||
|
|
||
| # Push to Nuget | ||
| dotnet nuget push .\Systray\bin\Release\citelao.SystrayIcon.0.1.0.1.nupkg --api-key $apiKey --source https://api.nuget.org/v3/index.json | ||
| # Dummy Nuget: | ||
| # dotnet nuget push .\Systray\bin\Release\citelao.SystrayIcon.0.1.0.nupkg --api-key $apiKey --source https://int.nugettest.org | ||
| ``` | ||
|
|
||
| ## TODO | ||
|
|
||
| ### Blockers | ||
|
|
||
| * [x] Split off systray code into a library | ||
| * [x] Support AnyCPU target | ||
| * [x] Support `<DisableRuntimeMarshalling>True</DisableRuntimeMarshalling>` | ||
| * [x] ^ Fix `WindowSubclassHandler` to support non-marshalled delegates. | ||
| * [x] License (ensure we cite WinForms) | ||
| * [x] Add README to package | ||
| * [x] Publish to NuGet | ||
| * [x] Add unit tests | ||
| * [x] Cleaner public types | ||
|
|
||
| ### Nice-to-have | ||
|
|
||
| * [x] Reorganize internal types (`NoReleaseHwnd`, `NoReleaseSafeHandle`, etc.) | ||
| * [ ] Upgrade to a newer commit of Doomgeneric (specifically, one after the [sound commit](https://github.com/ozkl/doomgeneric/commit/d0946b46cf617467f014a25e264fd952698a13f9)) | ||
| * [x] Automatically build the Rust bindings before building & launching the C#. | ||
| * [x] Deploy the Rust DLL alongside the C# so that you can run `dotnet run` anywhere. | ||
| * [ ] Better name in Taskbar personalization menu | ||
| * [x] Better logging | ||
|
|
||
| ### TODO Features | ||
|
|
||
| * [ ] Double-click to show full window | ||
| * [x] Right-click menu | ||
| * [ ] Click to play/pause(?) (invisible input window to play?) | ||
| # Systray Doom | ||
|
|
||
| ## Download | ||
|
|
||
| ```pwsh | ||
| # 1. Clone the repo | ||
| git clone https://github.com/citelao/systray-doom | ||
|
|
||
| # 2. Put DOOM1.WAD in the systray_doom/ directory (you can find the shareware free & legal online) | ||
| # cp somethingsomething | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| For usage of the systray library, see [the Systray README](./Systray/README.md). | ||
|
|
||
| > dotnet add package citelao.SystrayIcon | ||
|
|
||
| ## Dev | ||
|
|
||
| ```pwsh | ||
| # Build the Rust bindings | ||
| cd rust_bindings/ | ||
| cargo build | ||
|
|
||
| # Build & run the Dotnet! | ||
| cd .. | ||
| dotnet run --project .\systray_doom\systray_doom.csproj | ||
| ``` | ||
|
|
||
| ### Validating AOT compatibility | ||
|
|
||
| The Systray library is marked AOT-compatible, which *will* generate warnings for any issues in the library directly. However, that doesn't check its dependencies. To validate end-to-end: | ||
|
|
||
| ```pwsh | ||
| # Publish all the things! This verifies AOT-compatibility | ||
| # https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/prepare-libraries-for-trimming | ||
| dotnet publish -c Release | ||
| ``` | ||
|
|
||
| ### Publishing versions | ||
|
|
||
| Prerequisites (see above): | ||
|
|
||
| 1. Ensure it builds! | ||
| 2. Validate AOT compatibility | ||
|
|
||
| Then: | ||
|
|
||
| ```pwsh | ||
|
|
||
| # Get an API key | ||
| # (for initial push, use `*` glob pattern) | ||
| # https://www.nuget.org/account/apikeys | ||
| # https://int.nugettest.org/account/apikeys | ||
| $apiKey = # paste from the website | ||
|
|
||
| # Publish to main | ||
| git checkout main | ||
| git merge dev | ||
|
|
||
| # Confirm the base version | ||
| # Update version.json's `"version"` field if you need to change the major/minor/patch. | ||
| # Nerdbank.GitVersioning automatically calculates the 4th component based on git height. | ||
|
|
||
| # Update the CHANGELOG | ||
| # ... | ||
|
|
||
| # Create the nupkg | ||
| # https://learn.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli | ||
| dotnet build -c release | ||
| # => Systray\bin\Release\citelao.SystrayIcon.0.1.0.nupkg | ||
|
|
||
| ls Systray\bin\Release\*.nupkg | ||
|
|
||
| # Push to Nuget | ||
| dotnet nuget push .\Systray\bin\Release\citelao.SystrayIcon.0.1.0.1.nupkg --api-key $apiKey --source https://api.nuget.org/v3/index.json | ||
| # Dummy Nuget: | ||
| # dotnet nuget push .\Systray\bin\Release\citelao.SystrayIcon.0.1.0.nupkg --api-key $apiKey --source https://int.nugettest.org | ||
| ``` | ||
|
|
||
| ### Versioning notes | ||
|
|
||
| * Nerdbank.GitVersioning provides the package and assembly versions from `version.json`. The `version` property controls the first three digits (major/minor/patch). The build height becomes the fourth component automatically so you do not need to edit it manually. | ||
| * Non-`main` branches (e.g. `dev`) publish prerelease builds that include a `-dev` suffix before the commit hash for clarity. | ||
| * Nerdbank.GitVersioning can automate release version bumps via the [`nbgv prepare-release`](https://dotnet.github.io/Nerdbank.GitVersioning/docs/nbgv-cli.html#prepare-release) command. TODO: evaluate wiring that into our release flow so merges to `main` automatically advance the base version. | ||
| * GitHub Copilot and other agents that work from shallow clones should set `NBGV_GitEngine=Disabled` in their environment so Nerdbank.GitVersioning skips walking commit history. This avoids build failures at the cost of omitting commit metadata from generated version information. See the [shallow-cloning agents guide](https://dotnet.github.io/Nerdbank.GitVersioning/docs/shallow-cloning-agents.html) for details. | ||
|
|
||
| ## TODO | ||
|
|
||
| ### Blockers | ||
|
|
||
| * [x] Split off systray code into a library | ||
| * [x] Support AnyCPU target | ||
| * [x] Support `<DisableRuntimeMarshalling>True</DisableRuntimeMarshalling>` | ||
| * [x] ^ Fix `WindowSubclassHandler` to support non-marshalled delegates. | ||
| * [x] License (ensure we cite WinForms) | ||
| * [x] Add README to package | ||
| * [x] Publish to NuGet | ||
| * [x] Add unit tests | ||
| * [x] Cleaner public types | ||
|
|
||
| ### Nice-to-have | ||
|
|
||
| * [x] Reorganize internal types (`NoReleaseHwnd`, `NoReleaseSafeHandle`, etc.) | ||
| * [ ] Upgrade to a newer commit of Doomgeneric (specifically, one after the [sound commit](https://github.com/ozkl/doomgeneric/commit/d0946b46cf617467f014a25e264fd952698a13f9)) | ||
| * [x] Automatically build the Rust bindings before building & launching the C#. | ||
| * [x] Deploy the Rust DLL alongside the C# so that you can run `dotnet run` anywhere. | ||
| * [ ] Better name in Taskbar personalization menu | ||
| * [x] Better logging | ||
|
|
||
| ### TODO Features | ||
|
|
||
| * [ ] Double-click to show full window | ||
| * [x] Right-click menu | ||
| * [ ] Click to play/pause(?) (invisible input window to play?) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", | ||
| "version": "0.1.3", | ||
| "publicReleaseRefSpec": [ | ||
| "^refs/heads/main$", | ||
| "^refs/tags/v\\d+(?:\\.\\d+)?$" | ||
| ], | ||
| "gitCommitIdPrefix": "dev", | ||
| "cloudBuild": { | ||
| "buildNumber": { | ||
| "enabled": true | ||
| } | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
publicReleaseRefSpeclist is intended to mark tagged builds as public releases, but the regex^refs/tags/v\d+(?:\.\d+)?$only matches tags likev1orv1.2. Tags of the formv0.1.3—which the repo already uses for packages—will not match and therefore produce prerelease versions with thedevsuffix even when building from a release tag. This breaks the stated versioning flow because tagged releases will still be treated as prerelease packages. The pattern should allow two dots (e.g.(\.\d+){2}) so thatv<major>.<minor>.<patch>tags are considered public.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codex, let's remove tags from the publicReleaseRefSpec for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
publicReleaseRefSpecto exclude tag patterns so only main-branch builds count as public releases for now. version.jsonL4-L6Testing
View task →