From b1ff964956279859f36ebeed8041ef0fabaa7098 Mon Sep 17 00:00:00 2001 From: Jason Couture Date: Mon, 5 Feb 2024 06:24:55 -0500 Subject: [PATCH 1/2] Add nbgv - NerdBank git versioning --- .config/dotnet-tools.json | 12 ++++++++++++ Directory.Build.props | 9 +++++++++ version.json | 13 +++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 .config/dotnet-tools.json create mode 100644 Directory.Build.props create mode 100644 version.json diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 00000000..7c74cb22 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "nbgv": { + "version": "3.6.133", + "commands": [ + "nbgv" + ] + } + } +} \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..1dda2dd5 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,9 @@ + + + + + all + 3.6.133 + + + \ No newline at end of file diff --git a/version.json b/version.json new file mode 100644 index 00000000..98cd6960 --- /dev/null +++ b/version.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", + "version": "0.9", + "publicReleaseRefSpec": [ + "^refs/heads/master$", + "^refs/heads/v\\d+(?:\\.\\d+)?$" + ], + "cloudBuild": { + "buildNumber": { + "enabled": true + } + } +} \ No newline at end of file From a79cdc1852220e3a41d102331c9fe41fd83a8c01 Mon Sep 17 00:00:00 2001 From: Jason Couture Date: Mon, 5 Feb 2024 06:30:36 -0500 Subject: [PATCH 2/2] Run nbgv and print version as part of tests --- .github/workflows/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fab1ee4d..44dff1ef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,6 +25,13 @@ jobs: config: release steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Nerdbank.GitVersioning + uses: dotnet/nbgv@v0.4.2 + id: nbgv + - name: Output NuGet version + run: echo "NuGet version = ${{steps.nbgv.outputs.NuGetPackageVersion}}" - uses: actions/setup-dotnet@v3 with: dotnet-version: |