46 lines
1.2 KiB
YAML
46 lines
1.2 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
|
|
|
|
jobs:
|
|
release:
|
|
name: Build and Publish to NuGet
|
|
runs-on: windows
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
shell: pwsh
|
|
run: |
|
|
$tag = "${{ github.ref_name }}"
|
|
$version = $tag -replace '^v', ''
|
|
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
|
|
echo "Building version: $version"
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore
|
|
|
|
- name: Build
|
|
run: dotnet build --configuration Release --no-restore
|
|
|
|
- name: Run tests
|
|
run: dotnet test --configuration Release --no-build --verbosity normal
|
|
|
|
- name: Pack NuGet package
|
|
run: dotnet pack --configuration Release --no-build -o ./nupkg /p:PackageVersion=${{ steps.version.outputs.VERSION }}
|
|
|
|
- name: Publish to NuGet.org
|
|
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
|