.NET Restore, Build, Test & Publish #18
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: dotnet-restore-build-test-publish | |
run-name: .NET Restore, Build, Test & Publish | |
permissions: | |
contents: read | |
on: | |
push: | |
schedule: | |
- cron: '0 8 * * *' | |
jobs: | |
dotnet-restore-build-test-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: dotnet restore | |
run: dotnet restore | |
- name: dotnet build | |
run: dotnet build --no-restore --configuration Release | |
- name: dotnet test | |
run: dotnet test --no-build --configuration Release --verbosity normal --list-tests --blame | |
- name: dotnet nuget push to NuGet | |
if: github.ref == 'refs/heads/master' | |
run: dotnet nuget push **.nupkg --api-key ${{secrets.RETRY_NUGET}} --source "https://api.nuget.org/v3/index.json" --skip-duplicate | |
- name: dotnet nuget push to GitHub | |
if: github.ref == 'refs/heads/master' | |
run: dotnet nuget push **.nupkg --api-key ${{secrets.RETRY_GITHUB}} --source "https://nuget.pkg.github.com/lyndychivs/index.json" --skip-duplicate |