Skip to content

Delete .github/workflows/dotnetcorepush.yml #13

Delete .github/workflows/dotnetcorepush.yml

Delete .github/workflows/dotnetcorepush.yml #13

name: .NET Build/Publish
on:
push:
workflow_dispatch:
release:
types: [published]
branches:
- main
env:
CONFIGURATION: Release
GLOBALJSON: .\src\global.json
PROJECTDIRPATH: .\src\MauiNUnitRunner.Controls
TESTPROJECTDIRPATH: .\src\MauiNUnitRunner.Controls.Tests
SOLUTION: .\src\MauiNUnitRunner.sln
PROJECT: .\src\MauiNUnitRunner.Controls\MauiNUnitRunner.Controls.csproj
permissions:
contents: read
packages: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup .NET
uses: actions/[email protected]
with:
global-json-file: ${{ env.GLOBALJSON }}
- name: Restore with dotnet
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
max_attempts: 3
retry_on: error
command: dotnet restore "${{ env.SOLUTION }}"
- name: Build with dotnet
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
max_attempts: 3
retry_on: error
command: dotnet build "${{ env.SOLUTION }}" -c ${{ env.CONFIGURATION }} --no-restore
- name: Test with dotnet
run: dotnet test "${{ env.SOLUTION }}" -c ${{ env.CONFIGURATION }} --no-build --logger trx
- name: Pack with dotnet
run: dotnet pack "${{ env.PROJECT }}" -c ${{ env.CONFIGURATION }} --no-build
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: production-artifacts
path: |
${{ env.PROJECTDIRPATH }}\bin\${{ env.CONFIGURATION }}\*.nupkg
${{ env.TESTPROJECTDIRPATH }}\TestResults\*.trx
- name: Deploy to GPR with dotnet
if: github.event_name == 'release'
run: dotnet nuget push "${{ env.PROJECTDIRPATH }}\bin\${{ env.CONFIGURATION }}\*.nupkg" --source https://nuget.pkg.github.com/bstadick/index.json --api-key "${{ secrets.GITHUB_TOKEN }}" --skip-duplicate
- name: Deploy to nuget.org with dotnet
if: github.event_name == 'release'
run: dotnet nuget push "${{ env.PROJECTDIRPATH }}\bin\${{ env.CONFIGURATION }}\*.nupkg" --source https://api.nuget.org/v3/index.json --api-key "${{ secrets.NUGET_APIKEY }}" --skip-duplicate