Files
Misaki.HighPerformance/.gitea/workflows/publish-nuget.yaml
Misaki 8395914cef
Some checks failed
Publish NuGet Packages / publish (push) Failing after 1m36s
Fix workflow
2025-11-04 18:08:04 +09:00

61 lines
1.8 KiB
YAML

name: Publish NuGet Packages
on:
push:
tags:
- 'v*' # Trigger only on semantic version tags
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build all projects
run: dotnet build -c Release
- name: Pack all projects
run: |
set -e
for projfile in $(find . -name "*.csproj"); do
if grep -q "<IsPackable>True</IsPackable>" "$projfile"; then
echo "Packing $projfile..."
if ! dotnet pack "$projfile" -c Release -o ./artifacts; then
echo "Failed to pack $projfile"
fi
fi
done
- name: Publish all packages
env:
NUGET_API_KEY: ${{ secrets.NUGET_TOKEN }}
run: |
set -x
set +e
for projfile in $(find . -name "*.csproj"); do
if grep -q "<IsPackable>True</IsPackable>" "$projfile"; then
projname=$(basename "$projfile" .csproj)
echo "Checking $projname..."
pkg=$(find "$projname/bin/Release" -maxdepth 1 -type f \
-name "$projname.*.nupkg" ! -name "*.symbols.nupkg" | sort -V | tail -n1)
if [ -n "$pkg" ]; then
echo "Pushing $pkg"
dotnet nuget push "$pkg" \
--source "https://git.personalnas.com/api/packages/Misaki/nuget/index.json" \
--api-key "$NUGET_API_KEY"
else
echo "No package found for $projname"
fi
fi
done