maui-linux/.gitea/workflows/release.yml

42 lines
1.1 KiB
YAML

# OpenMaui Linux Release - Publish to NuGet
name: Release to NuGet
on:
release:
types: [published]
push:
tags:
- 'v*'
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_ROOT: C:\dotnet
jobs:
release:
name: Build and Publish to NuGet
runs-on: windows
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore dependencies
run: C:\dotnet\dotnet.exe restore
- name: Build
run: C:\dotnet\dotnet.exe build --configuration Release --no-restore
- name: Run tests
run: C:\dotnet\dotnet.exe test --configuration Release --no-build --verbosity normal
continue-on-error: true
- name: Pack NuGet package
run: C:\dotnet\dotnet.exe pack --configuration Release --no-build -o ./nupkg
- name: Publish to NuGet.org
run: |
foreach ($pkg in (Get-ChildItem .\nupkg\*.nupkg)) {
C:\dotnet\dotnet.exe nuget push $pkg.FullName --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
}