Skip to content

Commit 32ee848

Browse files
fix: target src/LevelZero.NET.csproj and use OIDC trusted publishing
1 parent 44cf409 commit 32ee848

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

.github/workflows/publish.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,21 @@ jobs:
1919
dotnet-version: '10.0.x'
2020

2121
- name: Restore
22-
run: dotnet restore
22+
run: dotnet restore src/LevelZero.NET.csproj
2323

2424
- name: Build
25-
run: dotnet build --configuration Release --no-restore
26-
27-
- name: Test
28-
run: dotnet test --configuration Release --no-build --verbosity normal
25+
run: dotnet build src/LevelZero.NET.csproj --configuration Release --no-restore
2926

3027
- name: Pack
28+
if: startsWith(github.ref, 'refs/tags/v')
3129
run: |
3230
VERSION=${GITHUB_REF#refs/tags/v}
33-
dotnet pack --configuration Release --no-build \
31+
dotnet pack src/LevelZero.NET.csproj --configuration Release --no-build \
3432
-p:PackageVersion=$VERSION \
3533
--output ./nupkgs
3634
3735
- name: Upload artifacts
36+
if: startsWith(github.ref, 'refs/tags/v')
3837
uses: actions/upload-artifact@v4
3938
with:
4039
name: nupkgs
@@ -59,13 +58,8 @@ jobs:
5958
with:
6059
dotnet-version: '10.0.x'
6160

62-
- name: Push to NuGet
61+
- name: Push to NuGet (OIDC trusted publishing)
6362
run: |
6463
dotnet nuget push ./nupkgs/*.nupkg \
65-
--api-key ${{ secrets.NUGET_API_KEY }} \
66-
--source https://api.nuget.org/v3/index.json \
67-
--skip-duplicate
68-
dotnet nuget push ./nupkgs/*.snupkg \
69-
--api-key ${{ secrets.NUGET_API_KEY }} \
7064
--source https://api.nuget.org/v3/index.json \
7165
--skip-duplicate

0 commit comments

Comments
 (0)