dotnet-geo-management/.gitea/workflows/publish-nuget.yml
Mathias Beaulieu-Duncan 35c09f0b3e
All checks were successful
Publish NuGet Packages / build-and-publish (push) Successful in 30s
remove upload artifacts, not support
2025-10-06 15:36:29 -04:00

60 lines
1.6 KiB
YAML

name: Publish NuGet Packages
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Extract version from tag
run: |
VERSION=${GITHUB_REF##*/}
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Publishing version: $VERSION"
- name: Restore dependencies
run: dotnet restore
- name: Build solution
run: dotnet build --configuration Release --no-restore
- name: Pack Abstractions
run: |
dotnet pack Svrnty.GeoManagement.Abstractions/Svrnty.GeoManagement.Abstractions.csproj \
--configuration Release \
--no-build \
--output ./artifacts \
-p:Version=${{ env.VERSION }}
- name: Pack Google Provider
run: |
dotnet pack Svrnty.GeoManagement.Google/Svrnty.GeoManagement.Google.csproj \
--configuration Release \
--no-build \
--output ./artifacts \
-p:Version=${{ env.VERSION }}
- name: List packages
run: ls -lh ./artifacts
- name: Publish to NuGet.org
run: |
dotnet nuget push ./artifacts/*.nupkg \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate