Skip to content

Commit

Permalink
changed github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniele Fetoni committed Aug 23, 2024
1 parent e98cd0c commit 81a60d5
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ defaults:
jobs:
create_nuget:
runs-on: ubuntu-latest
name: Create Nuget package
needs: [
run_test
]
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -57,36 +61,13 @@ jobs:
- name: Run tests
run: dotnet test ${{ env.TestsPath }} --configuration Release

create_release:
# https://github.com/actions/create-release
# if: github.event_name == 'release'
name: Create Release
runs-on: ubuntu-latest
needs: [
deploy,
run_test,
create_nuget
]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

deploy:
# Publish only when creating a GitHub Release
# https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
# You can update this logic if you want to manage releases differently
# if: github.event_name == 'release'
runs-on: ubuntu-latest
name: Deploy package on Nuget
needs: [
run_test,
create_nuget
Expand All @@ -109,4 +90,26 @@ jobs:
run: |
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}
}
create_release:
# https://github.com/actions/create-release
# if: github.event_name == 'release'
name: Create Release
runs-on: ubuntu-latest
needs: [
deploy
]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

0 comments on commit 81a60d5

Please sign in to comment.