Skip to content

Commit 7c10fc8

Browse files
author
Ulrik Baerholm
committed
Update for the package version setup and updated the publish action
1 parent 0de76fe commit 7c10fc8

File tree

3 files changed

+386
-10
lines changed

3 files changed

+386
-10
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,20 @@ jobs:
4545
run: dotnet test --configuration Release --no-build --verbosity normal
4646

4747
# Take the version from the tag name: "v1.2.3" -> "1.2.3"
48-
- name: Checkout
49-
uses: actions/checkout@v4
50-
with:
51-
fetch-depth: 0 # REQUIRED so versioning tools & tags work
52-
53-
# Convert tag v2.0.2 -> 2.0.2
5448
- name: Compute package version
5549
id: ver
5650
shell: bash
5751
run: |
5852
REF="${GITHUB_REF_NAME}"
5953
echo "version=${REF#v}" >> "$GITHUB_OUTPUT"
6054
61-
# Pack with an explicit version (covers both PackageVersion and Version)
6255
- name: Pack
6356
run: |
6457
dotnet pack ITW.FluentMasker/ITW.FluentMasker.csproj \
6558
--configuration Release \
6659
--no-build \
6760
-o ./artifacts \
68-
/p:PackageId=ITW.FluentMasker \
69-
/p:PackageVersion=${{ steps.ver.outputs.version }} \
70-
/p:Version=${{ steps.ver.outputs.version }}
61+
/p:PackageVersion=${{ steps.ver.outputs.version }}
7162
7263
# Push the package to NuGet.org using a stored API key
7364
- name: Push package to NuGet.org

ITW.FluentMasker/ITW.FluentMasker.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
<!-- NuGet Package Properties -->
1010
<PackageId>ITW.FluentMasker</PackageId>
1111

12+
<!-- MinVer Configuration for Automatic Versioning -->
13+
<!-- MinVer calculates version from Git tags and commit height -->
14+
<MinVerTagPrefix>v</MinVerTagPrefix>
15+
<MinVerMinimumMajorMinor>2.0</MinVerMinimumMajorMinor>
16+
<MinVerDefaultPreReleaseIdentifiers>preview</MinVerDefaultPreReleaseIdentifiers>
17+
<MinVerVerbosity>normal</MinVerVerbosity>
18+
1219
<Authors>Ulrik Baerholm</Authors>
1320
<Company>It-wrk</Company>
1421
<Product>FluentMasker</Product>

0 commit comments

Comments
 (0)