3030 if : github.ref == 'refs/heads/main'
3131 runs-on : ubuntu-latest
3232 needs : build
33+ permissions :
34+ contents : write
3335 steps :
3436 - uses : actions/checkout@v4
3537 - name : Setup .NET
@@ -48,19 +50,12 @@ jobs:
4850 ls ./GithubActionsHelloWorld/bin/Release
4951 dotnet nuget push ./GithubActionsHelloWorld/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TEST_TOKEN}} --source https://apiint.nugettest.org/v3/index.json
5052 - name : Github release
53+ shell : bash
5154 env :
52- GITHUB_TOKEN_EXISTS : ${{ secrets.GITHUB_TOKEN }}
53- if : env.GITHUB_TOKEN_EXISTS != ''
54- uses : " marvinpinto/action-automatic-releases@latest"
55- with :
56- repo_token : " ${{ secrets.GITHUB_TOKEN }}"
57- automatic_release_tag : " ${{ env.CURRENT_VERSION }}"
58- prerelease : false
59- title : " Release ${{ env.CURRENT_VERSION }}"
60- files : |
61- ./GithubActionsHelloWorld/bin/Release/*.nupkg
62- ./GithubActionsHelloWorld/bin/Release/*.snupkg
63-
55+ GITHUB_TOKEN : ${{ github.TOKEN }}
56+ if : env.GITHUB_TOKEN != ''
57+ run : |
58+ gh release create ${{env.CURRENT_VERSION}} ./GithubActionsHelloWorld/bin/Release/*.*nupkg --prerelease
6459 deployTest :
6560 if : github.ref != 'refs/heads/main'
6661 runs-on : ubuntu-latest
@@ -83,16 +78,10 @@ jobs:
8378 ls ./GithubActionsHelloWorld/bin/Release
8479 dotnet nuget push ./GithubActionsHelloWorld/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TEST_TOKEN}} --source https://apiint.nugettest.org/v3/index.json
8580 - name : Github release
81+ shell : bash
8682 env :
87- GITHUB_TOKEN_EXISTS : ${{ secrets.GITHUB_TOKEN }}
88- if : env.GITHUB_TOKEN_EXISTS != ''
89- uses : " marvinpinto/action-automatic-releases@latest"
90- with :
91- repo_token : " ${{ secrets.GITHUB_TOKEN }}"
92- automatic_release_tag : " ${{ env.CURRENT_VERSION }}"
93- prerelease : true
94- title : " Prerelease Build ${{ env.CURRENT_VERSION }}"
95- files : |
96- ./GithubActionsHelloWorld/bin/Release/*.nupkg
97- ./GithubActionsHelloWorld/bin/Release/*.snupkg
83+ GITHUB_TOKEN : ${{ github.TOKEN }}
84+ if : env.GITHUB_TOKEN != ''
85+ run : |
86+ gh release create ${{env.CURRENT_VERSION}} ./GithubActionsHelloWorld/bin/Release/*.*nupkg --prerelease
9887
0 commit comments