Skip to content

Commit 8464251

Browse files
authored
Merge pull request #23 from stesee/GithubCliRelease
Moving from composed gha to gh cli
2 parents 920e944 + c5b48d5 commit 8464251

File tree

1 file changed

+12
-23
lines changed

1 file changed

+12
-23
lines changed

.github/workflows/dotnet.yml

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
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

Comments
 (0)