Enforce full solution NuGet publish on every push
Some checks failed
NuGet Package Publish / nuget (push) Failing after 1m5s

This commit is contained in:
Joseph Doherty
2026-02-20 13:38:56 -05:00
parent fa626d53b2
commit 7006fd9377

View File

@@ -22,12 +22,33 @@ jobs:
- name: Pack
run: dotnet pack CBDDC.Libs.slnx --configuration Release --no-restore --output artifacts/nuget
- name: Verify expected packages
shell: bash
run: |
set -euo pipefail
expected=(
"ZB.MOM.WW.CBDDC.Core"
"ZB.MOM.WW.CBDDC.Hosting"
"ZB.MOM.WW.CBDDC.Network"
"ZB.MOM.WW.CBDDC.Persistence"
)
for id in "${expected[@]}"; do
if ! compgen -G "artifacts/nuget/${id}.*.nupkg" > /dev/null; then
echo "Missing package for ${id}"
exit 1
fi
done
find artifacts/nuget -name '*.nupkg' ! -name '*.symbols.nupkg' -print
- name: Publish to Gitea NuGet
shell: bash
env:
NUGET_SOURCE_URL: ${{ github.server_url }}/api/packages/${{ github.repository_owner }}/nuget/index.json
NUGET_USERNAME: ${{ secrets.NUGET_USERNAME || github.actor }}
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN || secrets.GITHUB_TOKEN }}
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN || secrets.PACKAGE_TOKEN || secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
@@ -43,8 +64,20 @@ jobs:
--password "$NUGET_TOKEN" \
--store-password-in-clear-text
find artifacts/nuget -name '*.nupkg' ! -name '*.symbols.nupkg' -print0 | \
xargs -0 -I{} dotnet nuget push "{}" \
shopt -s nullglob
packages=(artifacts/nuget/*.nupkg)
if [ ${#packages[@]} -eq 0 ]; then
echo "No NuGet packages found to publish."
exit 1
fi
for pkg in "${packages[@]}"; do
if [[ "$pkg" == *.symbols.nupkg ]]; then
continue
fi
dotnet nuget push "$pkg" \
--source gitea \
--api-key "$NUGET_TOKEN" \
--skip-duplicate
done