Skip to content

Commit

Permalink
fix(#5): Optimize pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
snovak7 committed May 13, 2024
1 parent 0291051 commit b61f52b
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NUGET_DIR: ${{ github.workspace}}/nuget

jobs:
publish:
Expand All @@ -26,10 +25,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'

- name: Setup .NET Core SDK 8
uses: actions/setup-dotnet@v4
with:
Expand All @@ -43,16 +39,23 @@ jobs:

- name: Pack .NET Solution
run: dotnet pack --configuration Release --no-build --output pack/
# if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}

- name: Publish .NET Solution to GitHub Packages
continue-on-error: true
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}

- name: Publish .NET Solution to NuGet.org
env:
apikey: ${{ secrets.NUGET_ORG_KEY }}
- name: Store .NET Package
uses: actions/upload-artifact@v4
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: pack/*.(s?)nupkg
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.NUGET_ORG_KEY }} --source nuget

- name: Publish .NET Solution to NuGet.org
continue-on-error: true
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.NUGET_ORG_KEY }} --source nuget
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}

0 comments on commit b61f52b

Please sign in to comment.