Update dotnet-nuget-publish.yml #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish NuGet | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '7.0' | |
- name: Test | |
run: dotnet test --verbosity normal | |
working-directory: ./NewZipAPITester | |
- name: Restore dependencies | |
run: dotnet restore | |
working-directory: ./NewZipAPI | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
working-directory: ./NewZipAPI | |
- 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: ./NewZipAPI/bin/Debug/*nupkg | |
- name: Push to GitHub Packages | |
run: dotnet nuget push "./NewZipAPI/bin/Debug/*nupkg/*.nupkg" --source "https://nuget.pkg.github.com/kyle079/index.json" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |