Skip to content

Commit

Permalink
Create dotnet-nuget-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle079 authored Feb 1, 2024
1 parent 9812186 commit a93a060
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/dotnet-nuget-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Publish NuGet

on:
push:
branches: [ main ] # or your default branch

jobs:
build:
runs-on: windows-latest, ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0'

- name: Restore dependencies
run: dotnet restore
working-directory: ./NewZipAPI

- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: ./NewZipAPI

- name: Test
run: dotnet test --no-restore --verbosity normal
working-directory: ./NewZipAPITester

- name: Pack
run: dotnet pack --configuration Release --no-build --output nupkgs
working-directory: ./NewZipAPI

- name: Publish to GitHub Packages
uses: actions/upload-artifact@v2
with:
name: nuget-packages
path: nupkgs/*.nupkg

- name: Push to GitHub Packages
run: dotnet nuget push "nupkgs/*.nupkg" --source "github" --skip-duplicate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a93a060

Please sign in to comment.