Skip to content

Commit

Permalink
Update build.yml (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
pr8x committed Jun 22, 2023
1 parent cecc952 commit ca731e5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types:
- published

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{ github.workspace}}/nuget

defaults:
run:
shell: pwsh

jobs:
build:
Expand All @@ -26,3 +38,23 @@ jobs:
run: dotnet build --no-restore /warnaserror
- name: Test
run: dotnet test --no-build --verbosity normal

publish_nuget:
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }}

- uses: actions/upload-artifact@v3
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: ${{ env.NuGetDirectory }}/*.nupkg

0 comments on commit ca731e5

Please sign in to comment.