File tree Expand file tree Collapse file tree 2 files changed +45
-6
lines changed
Expand file tree Collapse file tree 2 files changed +45
-6
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Publish NuGet
2+
3+ on :
4+ push :
5+ branches : [ main, master ]
6+ tags : [ 'v*' ]
7+
8+ permissions :
9+ contents : read
10+ packages : write
11+ id-token : write
12+
13+ jobs :
14+ publish :
15+ runs-on : windows-latest
16+
17+ steps :
18+ - uses : actions/checkout@v4
19+ - uses : actions/setup-dotnet@v4
20+ with :
21+ dotnet-version : ' 6.0.x'
22+
23+ - name : Setting up NuGet auth
24+ shell : pwsh
25+ run : |
26+ dotnet nuget add source https://nuget.pkg.github.com/Empty-Solution/index.json --name github --store-password-in-clear-text
27+ dotnet nuget update source github --username ${{ github.actor }} --password ${{ secrets.NUGET_TOKEN }} --store-password-in-clear-text
28+
29+ - name : Getting version
30+ id : version
31+ shell : pwsh
32+ run : |
33+ if ($env:GITHUB_REF -match "refs/tags/v(.+)") {
34+ $VERSION = $matches[1]
35+ } else {
36+ $VERSION = "1.0.0-alpha"
37+ }
38+ echo "VERSION=$VERSION" >> $env:GITHUB_OUTPUT
39+
40+ - name : Packing and Pushing
41+ working-directory : ./src
42+ shell : pwsh
43+ run : |
44+ dotnet pack -p:Version=${{ steps.version.outputs.VERSION }} --configuration Release
45+ dotnet nuget push "**/*.nupkg" --source github --api-key ${{ secrets.NUGET_TOKEN }} --skip-duplicate
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments