Skip to content

Commit 463a697

Browse files
authored
Update versioning system (#2)
* Update version.json to v2.2 and add release config Updated the `version` property in `version.json` to `2.2` to reflect the new version. Introduced the `publicReleaseRefSpec` property to enforce that public releases are triggered only from the `master` branch. These changes support improved versioning and release management. * Remove version properties from project file The `<AssemblyVersion>`, `<FileVersion>`, and `<Version>` properties were removed from `Collections.Pooled.csproj`. These properties previously defined the assembly version (`2.1.3.0`), file version (`2.1.3.0`), and package version (`2.1.3`). This change likely indicates a shift to centralized or automated versioning to simplify version management and align with updated build/release processes. * Remove issue templates; add .NET CI workflow Removed `bug_report.md` and `feature_request.md` templates, signaling a change in issue management practices. Added `dotnet.yml` GitHub Actions workflow to automate build and test processes for a .NET project. The workflow runs on `push` and `pull_request` events targeting the `master` branch, ensuring streamlined CI/CD with steps for dependency restoration, building, and testing. * Modify workflow to publish .NET package to NuGet Updated the workflow to publish a .NET package to NuGet, including new steps for versioning and packing.
1 parent 5a67b5e commit 463a697

5 files changed

Lines changed: 58 additions & 49 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/dotnet.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: Publish Package to NuGet
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build-and-publish:
13+
runs-on: ubuntu-latest
14+
environment: production
15+
permissions:
16+
id-token: write # enable GitHub OIDC token issuance for this job
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v5
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Get version info
25+
uses: dotnet/nbgv@master
26+
id: nbgv
27+
28+
- name: Setup .NET SDK
29+
uses: actions/setup-dotnet@v5
30+
with:
31+
dotnet-version: "9.0.x"
32+
33+
- name: Pack NuGet (Release)
34+
run: |
35+
dotnet pack Collections.Pooled/Collections.Pooled.csproj \
36+
-c Release \
37+
-p:ContinuousIntegrationBuild=true \
38+
-p:Version=${{ steps.nbgv.outputs.NuGetPackageVersion }} \
39+
-p:AssemblyVersion=${{ steps.nbgv.outputs.AssemblyVersion }} \
40+
-p:FileVersion=${{ steps.nbgv.outputs.AssemblyFileVersion }} \
41+
-o artifacts
42+
43+
# Get a short-lived NuGet API key
44+
- name: NuGet login (OIDC → temp API key)
45+
uses: NuGet/login@v1
46+
id: login
47+
with:
48+
user: ${{ secrets.NUGET_USER }}
49+
50+
# Push the package
51+
- name: NuGet Push
52+
run: dotnet nuget push artifacts/*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json

Collections.Pooled/Collections.Pooled.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
<PackageId>Collections.Pooled.V2</PackageId>
2222
<Product>Collections.Pooled.V2</Product>
2323
<AssemblyTitle>Collections.Pooled.V2</AssemblyTitle>
24-
<AssemblyVersion>2.1.3.0</AssemblyVersion>
25-
<FileVersion>2.1.3.0</FileVersion>
26-
<Version>2.1.3</Version>
2724
<Authors>tolzy88, jtmueller</Authors>
2825
<Company />
2926
<Description>Fast, low-allocation ports of List, Dictionary, HashSet, Stack, and Queue using ArrayPool and Span.</Description>

version.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": "2.2",
3+
"publicReleaseRefSpec": [
4+
"^refs/heads/master$"
5+
]
6+
}

0 commit comments

Comments
 (0)