Make Gitea NuGet workflow POSIX-shell compatible for runner execution.
Some checks failed
NuGet Publish / build-and-pack (push) Successful in 44s
NuGet Publish / publish-to-gitea (push) Failing after 44s

This commit is contained in:
Joseph Doherty
2026-02-20 13:40:57 -05:00
parent 2b0d66b7b5
commit 9cafd56267

View File

@@ -13,10 +13,11 @@ jobs:
steps: steps:
- name: Checkout Repository - name: Checkout Repository
run: | run: |
set -euo pipefail set -eu
REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
if [ -n "${GITHUB_TOKEN:-}" ]; then if [ -n "${GITHUB_TOKEN:-}" ]; then
REPO_URL="${GITHUB_SERVER_URL/https:\/\//https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@}/${GITHUB_REPOSITORY}.git" HOST="${GITHUB_SERVER_URL#https://}"
REPO_URL="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${HOST}/${GITHUB_REPOSITORY}.git"
fi fi
git init . git init .
@@ -51,10 +52,11 @@ jobs:
steps: steps:
- name: Checkout Repository - name: Checkout Repository
run: | run: |
set -euo pipefail set -eu
REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
if [ -n "${GITHUB_TOKEN:-}" ]; then if [ -n "${GITHUB_TOKEN:-}" ]; then
REPO_URL="${GITHUB_SERVER_URL/https:\/\//https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@}/${GITHUB_REPOSITORY}.git" HOST="${GITHUB_SERVER_URL#https://}"
REPO_URL="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${HOST}/${GITHUB_REPOSITORY}.git"
fi fi
git init . git init .
@@ -79,7 +81,7 @@ jobs:
- name: Configure Gitea NuGet Source - name: Configure Gitea NuGet Source
run: | run: |
set -euo pipefail set -eu
USERNAME="${GITEA_NUGET_USERNAME:-${GITHUB_ACTOR}}" USERNAME="${GITEA_NUGET_USERNAME:-${GITHUB_ACTOR}}"
TOKEN="${GITEA_NUGET_TOKEN:-${GITHUB_TOKEN:-}}" TOKEN="${GITEA_NUGET_TOKEN:-${GITHUB_TOKEN:-}}"
@@ -98,9 +100,11 @@ jobs:
- name: Publish Packages - name: Publish Packages
run: | run: |
set -euo pipefail set -eu
for pkg in nupkgs/*.nupkg; do for pkg in nupkgs/*.nupkg; do
if [ -f "$pkg" ] && [[ "$pkg" != *.snupkg ]]; then [ -f "$pkg" ] || continue
dotnet nuget push "$pkg" --source gitea --skip-duplicate case "$pkg" in
fi *.snupkg) continue ;;
esac
dotnet nuget push "$pkg" --source gitea --skip-duplicate
done done