fix(ci): pass Gitea context vars via env instead of GITHUB_*
Release / build (amd64, freebsd) (push) Successful in 57s
Release / build (amd64, linux) (push) Successful in 1m0s
Release / build (arm64, freebsd) (push) Successful in 1m2s
Release / build (arm64, linux) (push) Successful in 1m0s
Release / build (loong64, linux) (push) Successful in 1m1s
Release / build (riscv64, freebsd) (push) Successful in 59s
Release / build (riscv64, linux) (push) Successful in 59s
Release / release (push) Failing after 18s

This commit is contained in:
2026-07-26 21:29:45 +02:00
parent c3418b3c3b
commit 96e47ab87a
+12 -7
View File
@@ -109,6 +109,9 @@ jobs:
- name: Create release - name: Create release
env: env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_SERVER_URL: ${{ gitea.server_url }}
GITEA_REPOSITORY: ${{ gitea.repository }}
GITEA_REF_NAME: ${{ gitea.ref_name }}
run: | run: |
set -euo pipefail set -euo pipefail
# JSON-escape the release body with sed: backslashes first, then # JSON-escape the release body with sed: backslashes first, then
@@ -126,13 +129,13 @@ jobs:
-H "Authorization: token ${GITEA_TOKEN}" \ -H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-X POST \ -X POST \
"${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases" \ "${GITEA_SERVER_URL}/api/v1/repos/${GITEA_REPOSITORY}/releases" \
-d "{ -d "{
\"tag_name\": \"${GITHUB_REF_NAME}\", \"tag_name\": \"${GITEA_REF_NAME}\",
\"name\": \"${GITHUB_REF_NAME}\", \"name\": \"${GITEA_REF_NAME}\",
\"body\": ${BODY}, \"body\": ${BODY},
\"draft\": false, \"draft": false,
\"prerelease\": false \"prerelease": false
}") }")
http_code=$(echo "$response" | tail -1) http_code=$(echo "$response" | tail -1)
@@ -152,6 +155,8 @@ jobs:
- name: Upload assets - name: Upload assets
env: env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_SERVER_URL: ${{ gitea.server_url }}
GITEA_REPOSITORY: ${{ gitea.repository }}
run: | run: |
set -euo pipefail set -euo pipefail
RELEASE_ID=$(cat release-id.txt) RELEASE_ID=$(cat release-id.txt)
@@ -166,7 +171,7 @@ jobs:
-H "Content-Type: application/octet-stream" \ -H "Content-Type: application/octet-stream" \
-X POST \ -X POST \
--data-binary "@${binary}" \ --data-binary "@${binary}" \
"${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${fname}") "${GITEA_SERVER_URL}/api/v1/repos/${GITEA_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${fname}")
echo " HTTP ${http_code}" echo " HTTP ${http_code}"
if [ "$http_code" != "201" ]; then if [ "$http_code" != "201" ]; then
echo "Failed to upload ${fname}" echo "Failed to upload ${fname}"
@@ -175,5 +180,5 @@ jobs:
done done
echo echo
echo "Release ${GITHUB_REF_NAME} is live with the following assets:" echo "Release ${GITEA_REF_NAME} is live with the following assets:"
ls -lh dist/nuntius-*/ ls -lh dist/nuntius-*/