File tree Expand file tree Collapse file tree 2 files changed +51
-2
lines changed
Expand file tree Collapse file tree 2 files changed +51
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Publish .NET Package
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+
8+ permissions :
9+ contents : read
10+ packages : write
11+
12+ jobs :
13+ build-and-publish :
14+ runs-on : macos-latest
15+
16+ steps :
17+ - name : Checkout
18+ uses : actions/checkout@v5
19+
20+ - name : Setup .NET
21+ uses : actions/setup-dotnet@v5
22+ with :
23+ dotnet-version : 10.0.x
24+ source-url : https://nuget.pkg.github.com/${{github.repository_owner}}/index.json
25+ env :
26+ NUGET_AUTH_TOKEN : ${{secrets.GITHUB_TOKEN}}
27+
28+ - name : Install Workloads
29+ run : dotnet workload install android macos ios tvos maccatalyst --ignore-failed-sources
30+
31+ - name : Restore
32+ run : dotnet restore
33+
34+ - name : Building
35+ run : dotnet build --configuration Release --no-restore
36+
37+ - name : Packaging
38+ run : dotnet pack --configuration Release --no-build --output .
39+
40+ - name : Publishing
41+ if : github.event_name == 'push'
42+ run : dotnet nuget push *.nupkg --api-key ${{secrets.GITHUB_TOKEN}}
Original file line number Diff line number Diff line change 33` Hazelnut.Log ` is Logging framework.
44
55``` shell
6- $ # Using Nuget Package Manager Console
7- $ nuget Install-Package Hazelnut.Log
6+ $ # Add Package Source of GitHub to .NET
7+ $ # This is required before add package
8+ $ dotnet nuget add source " https://nuget.pkg.github.com/daramkun/index.json" \
9+ --name " GitHub" \
10+ --username " <YOUR GITHUB USERNAME>" \
11+ --password " <YOUR PAT TOKEN>" \
12+ --store-password-in-clear-text
813```
914
1015``` shell
1116$ # Using .NET CLI
1217$ dotnet add package Hazelnut.Log
1318```
1419
20+ or
21+
1522``` xml
1623<!-- Using csproj -->
1724<PackageReference Include =" Hazelnut.Log" Version =" 1.0.1" />
You can’t perform that action at this time.
0 commit comments