Skip to content

Commit c068910

Browse files
author
AndrewMorgan1
committed
2 parents f41b420 + ba543de commit c068910

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
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-
41
name: .NET Build, Test & Publish
52

63
on:
74
push:
85
branches: [ "master" ]
96
tags:
10-
- 'v*' # e.g. v1.0.0, v1.1.1
7+
- 'v*' # e.g. v1.1.0, v1.2.3
118
pull_request:
129
branches: [ "master" ]
1310

1411
jobs:
1512
build:
1613
runs-on: ubuntu-latest
14+
1715
steps:
1816
- uses: actions/checkout@v4
1917

@@ -25,10 +23,10 @@ jobs:
2523
- name: Restore dependencies
2624
run: dotnet restore
2725

28-
- name: Build
26+
- name: Build solution
2927
run: dotnet build --no-restore --configuration Release
3028

31-
- name: Test with coverage
29+
- name: Run tests with coverage
3230
run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --results-directory ./TestResults
3331

3432
- name: Upload coverage to Codecov
@@ -45,6 +43,7 @@ jobs:
4543
if: startsWith(github.ref, 'refs/tags/v')
4644
needs: build
4745
runs-on: ubuntu-latest
46+
4847
steps:
4948
- uses: actions/checkout@v4
5049

@@ -56,8 +55,14 @@ jobs:
5655
- name: Restore dependencies
5756
run: dotnet restore
5857

59-
- name: Build package
58+
# ✅ Pack the Core library
59+
- name: Pack TokenKit.Core
60+
run: dotnet pack src/TokenKit.Core --configuration Release -p:PackageVersion=${GITHUB_REF#refs/tags/v} -o ./nupkg
61+
62+
# ✅ Pack the main CLI/SDK library
63+
- name: Pack TokenKit
6064
run: dotnet pack src/TokenKit --configuration Release -p:PackageVersion=${GITHUB_REF#refs/tags/v} -o ./nupkg
6165

66+
# ✅ Publish all .nupkg files in /nupkg to NuGet.org
6267
- name: Publish to NuGet
6368
run: dotnet nuget push "./nupkg/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)