1+ name : release
2+
3+ on :
4+ push :
5+ tags :
6+ - v*
7+
8+ env :
9+ CONFIGURATION : Release
10+ DOTNET_NOLOGO : true
11+
12+ permissions :
13+ contents : read
14+
15+ concurrency :
16+ group : ${{ github.workflow }}-${{ github.event.number || github.ref }}
17+ cancel-in-progress : true
18+
19+ jobs :
20+ release :
21+ runs-on : windows-latest
22+ timeout-minutes : 15
23+ permissions :
24+ packages : write
25+ contents : write
26+
27+ steps :
28+ - uses : actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
29+
30+ - uses : actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
31+ with :
32+ path : ~/.nuget/packages
33+ # Look to see if there is a cache hit for the corresponding requirements file
34+ # key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
35+ key : ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
36+ # restore-keys: |
37+ # ${{ runner.os }}-nuget
38+
39+ - name : restore
40+ run : dotnet restore
41+
42+ - name : build
43+ run : dotnet build --no-restore
44+
45+ - name : pack
46+ run : dotnet pack --no-build -o bin
47+
48+ - uses : actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
49+ with :
50+ name : packages
51+ path : bin/*.nupkg
52+
53+ - name : deploy github.com
54+ run : find bin -name '*.nupkg' | xargs dotnet nuget push -s $NUGET_SOURCE -k $NUGET_KEY --skip-duplicate --force-english-output
55+ shell : bash
56+ env :
57+ NUGET_SOURCE : https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
58+ NUGET_KEY : ${{ secrets.GITHUB_TOKEN }}
59+
60+ - name : deploy nuget.org
61+ run : find bin -name '*.nupkg' | xargs dotnet nuget push -s $NUGET_SOURCE -k $NUGET_KEY --skip-duplicate --force-english-output
62+ shell : bash
63+ env :
64+ NUGET_SOURCE : https://api.nuget.org/v3/index.json
65+ NUGET_KEY : ${{ secrets.NUGET_API_KEY }}
66+
67+ - uses : marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1
68+ with :
69+ repo_token : ${{ secrets.GITHUB_TOKEN }}
70+ prerelease : ${{ contains(github.ref_name, '-') }}
0 commit comments