dotnet-geo-management/.gitea/workflows/publish-nuget.yml
Mathias Beaulieu-Duncan 1feb6a7169
Some checks failed
Publish NuGet Packages / build-and-publish (push) Failing after 35s
remove tests in publishing nuget, should be seperated if needed
2025-10-06 15:29:57 -04:00

67 lines
1.7 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
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages-${{ env.VERSION }}
path: ./artifacts/*.nupkg