Skip to content

Commit c4771dc

Browse files
authored
Merge pull request #3 from cloudtoid/update/nuget-trusted-publishing
Use NuGet trusted publishing and include package README
2 parents 1ff161a + 863239d commit c4771dc

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ on:
66

77
jobs:
88
build:
9+
permissions:
10+
contents: read
11+
id-token: write
912
runs-on: ubuntu-latest
1013
name: Build Pack and Publish
1114
steps:
1215
- uses: actions/checkout@v7
1316

14-
- name: Setup .NET 9
17+
- name: Setup .NET 10
1518
uses: actions/setup-dotnet@v6
1619
with:
1720
dotnet-version: 10.0.x
@@ -22,5 +25,11 @@ jobs:
2225
- name: Pack
2326
run: dotnet pack -c Release --no-build --output . --version-suffix ${{github.run_number}} src/Cloudtoid.CodeAnalysis.csproj
2427

28+
- name: NuGet login
29+
uses: NuGet/login@v1
30+
id: nuget-login
31+
with:
32+
user: pedramr
33+
2534
- name: Push
26-
run: dotnet nuget push Cloudtoid.CodeAnalysis.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.nuget_org_api_key }}
35+
run: dotnet nuget push Cloudtoid.CodeAnalysis.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }}

‎src/Cloudtoid.CodeAnalysis.csproj‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<!-- NuGet Packaging -->
88
<PropertyGroup>
9+
<PackageReadmeFile>README.md</PackageReadmeFile>
910
<PackageId>Cloudtoid.CodeAnalysis</PackageId>
1011
<Title>Cloudtoid.CodeAnalysis</Title>
1112
<Authors>pedram@rezaei.us</Authors>
@@ -35,4 +36,8 @@
3536
<Content Include="assets\stylecop.json" PackagePath="build" />
3637
</ItemGroup>
3738

39+
<ItemGroup>
40+
<None Include="../README.md" Pack="true" PackagePath="/" />
41+
</ItemGroup>
42+
3843
</Project>

0 commit comments

Comments
 (0)