3232 git push origin --tags
3333 pwd
3434
35- deployPreRelease :
36- if : github.ref ! = 'refs/heads/main'
35+ deployRelease :
36+ if : github.ref = = 'refs/heads/main'
3737 runs-on : ubuntu-latest
3838 needs : build
3939 steps :
@@ -46,27 +46,31 @@ jobs:
4646 run : dotnet restore
4747 - name : Build
4848 run : dotnet build --configuration Release --no-restore
49- - name : Publish
50- run : dotnet publish --configuration Release --no-restore
5149 - name : NugetPush
5250 run : |
51+ dotnet nuget push ./GithubActionsHelloWorld/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source https://api.nuget.org/v3/index.json
52+ - uses : " marvinpinto/action-automatic-releases@latest"
53+ with :
54+ repo_token : " ${{ secrets.GITHUB_TOKEN }}"
55+ automatic_release_tag : ${{ env.CURRENT_VERSION }}
56+ prerelease : false
57+ title : " Release Build"
58+ files : |
5359 ls ./GithubActionsHelloWorld/bin/Release
5460 dotnet nuget push ./GithubActionsHelloWorld/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source https://apiint.nugettest.org/v3/index.json
55- - uses : papeloto/action-zip@v1
56- with :
57- files : ./GithubActionsHelloWorld/bin/Release/net6.0/publish/
58- dest : GithubActionsHelloWorld.zip
5961 - uses : " marvinpinto/action-automatic-releases@latest"
6062 with :
6163 repo_token : " ${{ secrets.GITHUB_TOKEN }}"
62- automatic_release_tag : ${{ env.CURRENT_VERSION }}
64+ automatic_release_tag : " latest-prerelease "
6365 prerelease : true
66+ title : " Prerelease Build"
6467 files : |
6568 LICENSE
66- GithubActionsHelloWorld.zip
69+ ./GithubActionsHelloWorld/bin/Release/*.nupkg
70+ ./GithubActionsHelloWorld/bin/Release/*.snupkg
6771
68- deployRelease :
69- if : github.ref = = 'refs/heads/main'
72+ deployTest :
73+ if : github.ref ! = 'refs/heads/main'
7074 runs-on : ubuntu-latest
7175 needs : build
7276 steps :
@@ -79,23 +83,19 @@ jobs:
7983 run : dotnet restore
8084 - name : Build
8185 run : dotnet build --configuration Release --no-restore
82- - name : Publish
83- run : dotnet publish --configuration Release --no-restore
8486 - name : NugetPush
8587 run : |
8688 ls ./GithubActionsHelloWorld/bin/Release
8789 dotnet nuget push ./GithubActionsHelloWorld/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source https://apiint.nugettest.org/v3/index.json
8890 # dotnet nuget push ./GithubActionsHelloWorld/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source https://api.nuget.org/v3/index.json
89- - uses : papeloto/action-zip@v1
90- with :
91- files : ./GithubActionsHelloWorld/bin/Release/net6.0/publish/
92- dest : GithubActionsHelloWorld.zip
9391 - uses : " marvinpinto/action-automatic-releases@latest"
9492 with :
9593 repo_token : " ${{ secrets.GITHUB_TOKEN }}"
96- automatic_release_tag : ${{ env.CURRENT_VERSION }}
94+ automatic_release_tag : " latest-prerelease"
95+ prerelease : true
96+ title : " Prerelease Build"
9797 files : |
9898 LICENSE
99- GithubActionsHelloWorld.zip
100-
99+ ./ GithubActionsHelloWorld/bin/Release/*.nupkg
100+ ./GithubActionsHelloWorld/bin/Release/*.snupkg
101101
0 commit comments