Skip to content

Merge pull request #80 from rprouse/json-update #37

Merge pull request #80 from rprouse/json-update

Merge pull request #80 from rprouse/json-update #37

Workflow file for this run

name: .NET Core Build Test and Publish
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout Code
uses: actions/checkout@v3
- name: πŸ’‰ Install dependencies
run: dotnet restore
- name: πŸ› οΈ Build
run: dotnet build --configuration Release --no-restore
- name: βœ… Test
run: dotnet test --no-restore --verbosity normal
- name: πŸ“¦ Package NuGet
run: dotnet pack --no-build --configuration Release src/todo/todo.csproj
- name: πŸ“€ Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: nupkg
path: src/todo/nupkg/*.nupkg
publish:
runs-on: ubuntu-latest
needs: build
# only push nuget package for PRs merged to master
if: github.ref == 'refs/heads/main'
steps:
- name: πŸ“₯ Download Artifacts
uses: actions/download-artifact@v3
with:
name: nupkg
- name: πŸ”‘ Authenticate to GitHub Packages
run: dotnet nuget add source --username rprouse --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/rprouse/index.json"
- name: πŸ“€ Publish NuGet to GitHub Packages
run: dotnet nuget push "**/dotnet-todo.*.nupkg" -k ${{ secrets.GITHUB_TOKEN }} --source "github" --skip-duplicate --no-symbols
- name: πŸ“€ Publish NuGet to NuGet.org
run: dotnet nuget push "**/dotnet-todo.*.nupkg" -k ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json