MVP #10
Workflow file for this run
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: Release | |
on: | |
pull_request: {} | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
workflow_dispatch: {} | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
jobs: | |
publish: | |
env: | |
ASPIRE_ALLOW_UNSECURED_TRANSPORT: true | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET Core SDK 8 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
8.0.x | |
- name: Restore .NET Packages | |
run: | | |
dotnet workload restore "./Migrator.sln" | |
dotnet restore "./Migrator.sln" --locked-mode | |
- name: Build .NET Solution | |
run: dotnet build "./Migrator.sln" --configuration Release --no-restore | |
- name: Test .NET Solution | |
run: > | |
dotnet test "./Migrator.sln" | |
--collect:"XPlat Code Coverage" --no-build --configuration Release | |
--logger console --logger GitHubActions --logger "trx;LogFilePrefix=test-results" | |
-property:DeterministicSourcePaths=true -property:IncludeTestAssembly=true | |
--results-directory '${{ github.workspace }}/reports/coverage/' | |
-- | |
RunConfiguration.CollectSourceInformation=true | |
timeout-minutes: 1 | |
- name: Upload Test Artifacts | |
uses: actions/upload-artifact@v4 | |
if: success() || failure() | |
with: | |
name: test-results | |
path: "**/test-results*.trx" | |
- name: Pack .NET Solution | |
run: dotnet pack "./Migrator.sln" --configuration Release --no-build --output pack/ | |
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }} | |
- name: Publish .NET Solution to GitHub Packages | |
continue-on-error: true | |
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" | |
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }} | |
- name: Store .NET Package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget | |
if-no-files-found: error | |
retention-days: 7 | |
path: pack/*.nupkg | |
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }} | |
- name: Publish .NET Solution to NuGet.org | |
continue-on-error: true | |
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.NUGET_ORG_KEY }} --source nuget | |
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }} |