Skip to content

Commit

Permalink
Reworking NuGet action to run on-release published, instead of on eve…
Browse files Browse the repository at this point in the history
…ry push
  • Loading branch information
NoelFB committed Sep 22, 2023
1 parent e322e6d commit 30a042e
Showing 1 changed file with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
name: Build

name: Publish NuGet Package
on:
push:
branches:
- 'main'
paths-ignore:
- '*.md'
pull_request:
paths-ignore:
- '*.md'
release:
types: [published]

jobs:
build:
publish_nuget:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -23,12 +15,10 @@ jobs:
with:
dotnet-version: '7.0.x'

- name: Build
run: dotnet build Foster.sln --configuration Release

- name: Pack
run: dotnet pack Foster.sln --configuration Release
run: |
dotnet build -c Release
dotnet pack -c Release
- name: Publish to NuGet
if: github.event_name == 'push'
- name: Push
run: dotnet nuget push artifacts/**/*.nupkg -k ${{secrets.NUGET_TOKEN}} --skip-duplicate --source https://api.nuget.org/v3/index.json

0 comments on commit 30a042e

Please sign in to comment.