11name : .NET build and test
2+ env :
3+ LAST_COMMIT_MESSAGE : ${{ github.event.head_commit.message }}
24
35on :
46 push :
5- branches : [ main, automated-nuget.org-publish ]
67 pull_request :
7- branches : [ main, automated-nuget.org-publish ]
88
99jobs :
1010 build :
@@ -29,10 +29,10 @@ jobs:
2929 echo "done!"
3030 pwd
3131
32- deploy :
32+ deployMain :
33+ if : github.ref == 'refs/heads/main'
3334 runs-on : ubuntu-latest
3435 needs : build
35- if : github.ref == 'refs/heads/master'
3636 steps :
3737 - uses : actions/checkout@v2
3838 - name : Setup .NET
4848 - name : NugetPush
4949 run : |
5050 ls ./GithubActionsHelloWorld/bin/Release
51- dotnet nuget push ./GithubActionsHelloWorld/bin/Release/*.*nupkg --skip-duplicate --include-symbols -p:SymbolPackageFormat=snupkg --api-key ${{secrets.NUGET_TOKEN}} --source https://int.nugettest.org/
51+ dotnet nuget push ./GithubActionsHelloWorld/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source https://apiint.nugettest.org/v3/index.json
52+ # dotnet nuget push ./GithubActionsHelloWorld/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source https://api.nuget.org/v3/index.json
5253 - uses : papeloto/action-zip@v1
5354 with :
5455 files : ./GithubActionsHelloWorld/bin/Release/net6.0/publish/
5758 with :
5859 repo_token : " ${{ secrets.GITHUB_TOKEN }}"
5960 automatic_release_tag : " latest"
61+ title : " Release Build"
62+ files : |
63+ LICENSE
64+ GithubActionsHelloWorld.zip
65+
66+ deployTest :
67+ if : github.ref != 'refs/heads/main'
68+ runs-on : ubuntu-latest
69+ needs : build
70+ steps :
71+ - uses : actions/checkout@v2
72+ - name : Setup .NET
73+ uses : actions/setup-dotnet@v1
74+ with :
75+ dotnet-version : 6.0.x
76+ - name : Restore dependencies
77+ run : dotnet restore
78+ - name : Build
79+ run : dotnet build --configuration Release --no-restore
80+ - name : Publish
81+ run : dotnet publish --configuration Release --no-restore
82+ - name : NugetPush
83+ run : |
84+ ls ./GithubActionsHelloWorld/bin/Release
85+ dotnet nuget push ./GithubActionsHelloWorld/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source https://apiint.nugettest.org/v3/index.json
86+ - uses : papeloto/action-zip@v1
87+ with :
88+ files : ./GithubActionsHelloWorld/bin/Release/net6.0/publish/
89+ dest : GithubActionsHelloWorld.zip
90+ - uses : " marvinpinto/action-automatic-releases@latest"
91+ with :
92+ repo_token : " ${{ secrets.GITHUB_TOKEN }}"
93+ automatic_release_tag : " latest-prerelease"
6094 prerelease : true
61- title : " Development Build"
95+ title : " Prerelease Build"
6296 files : |
6397 LICENSE
6498 GithubActionsHelloWorld.zip
0 commit comments