Skip to content

Update dotnet-core.yml #107

Update dotnet-core.yml

Update dotnet-core.yml #107

Workflow file for this run

name: .NET Core
on:
push:
branches: [ main]
pull_request:
branches: [ main ]
env:
nuget_folder: "\\packages"
upload_folder: "AstronomyPictureOfTheDay\\bin\\Release"
jobs:
build:
runs-on: 'windows-2022'
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
- name: pack Nuget Packages
run: dotnet pack AstronomyPictureOfTheDay\AstronomyPictureOfTheDay.csproj --output ${{env.nuget_folder}}
- name: publish Nuget Packages to GitHub
run: dotnet nuget push ${{env.nuget_folder}}\*.nupkg source ${{vars.NUGET_FEED}} --api-key ${{secrets.NUGET_PACKAGE_UPLOAD}} --skip-duplicate
if: github.event_name != 'pull_request'
- name: Upload Artifact
uses: actions/[email protected]
with:
name: published_nuget
path: ${{env.upload_folder}}