fix(ci): use single-line JSON for curl and add missing GITEA_REF_NAME
Release / build (amd64, freebsd) (push) Successful in 56s
Release / build (amd64, linux) (push) Successful in 58s
Release / build (arm64, freebsd) (push) Successful in 58s
Release / build (arm64, linux) (push) Successful in 58s
Release / build (loong64, linux) (push) Successful in 1m3s
Release / build (riscv64, freebsd) (push) Successful in 1m1s
Release / build (riscv64, linux) (push) Successful in 1m1s
Release / release (push) Successful in 20s
Release / build (amd64, freebsd) (push) Successful in 56s
Release / build (amd64, linux) (push) Successful in 58s
Release / build (arm64, freebsd) (push) Successful in 58s
Release / build (arm64, linux) (push) Successful in 58s
Release / build (loong64, linux) (push) Successful in 1m3s
Release / build (riscv64, freebsd) (push) Successful in 1m1s
Release / build (riscv64, linux) (push) Successful in 1m1s
Release / release (push) Successful in 20s
This commit is contained in:
@@ -114,15 +114,7 @@ jobs:
|
||||
GITEA_REF_NAME: ${{ gitea.ref_name }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# JSON-escape the release body with sed: backslashes first, then
|
||||
# quotes, tabs, and carriage returns, and finally fold newlines into
|
||||
# \n. Wrap the result in quotes to form a JSON string.
|
||||
BODY=$(sed -e 's/\\/\\\\/g' \
|
||||
-e 's/"/\\"/g' \
|
||||
-e 's/\t/\\t/g' \
|
||||
-e 's/\r//g' \
|
||||
release-body.md \
|
||||
| sed ':a;N;$!ba;s/\n/\\n/g')
|
||||
BODY=$(sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/\t/\\t/g' -e 's/\r//g' release-body.md | sed ':a;N;$!ba;s/\n/\\n/g')
|
||||
BODY="\"${BODY}\""
|
||||
|
||||
response=$(curl -sS -w '\n%{http_code}' \
|
||||
@@ -130,13 +122,7 @@ jobs:
|
||||
-H "Content-Type: application/json" \
|
||||
-X POST \
|
||||
"${GITEA_SERVER_URL}/api/v1/repos/${GITEA_REPOSITORY}/releases" \
|
||||
-d "{
|
||||
\"tag_name\": \"${GITEA_REF_NAME}\",
|
||||
\"name\": \"${GITEA_REF_NAME}\",
|
||||
\"body\": ${BODY},
|
||||
\"draft": false,
|
||||
\"prerelease": false
|
||||
}")
|
||||
-d "{\"tag_name\":\"${GITEA_REF_NAME}\",\"name\":\"${GITEA_REF_NAME}\",\"body\":${BODY},\"draft\":false,\"prerelease\":false}")
|
||||
|
||||
http_code=$(echo "$response" | tail -1)
|
||||
body=$(echo "$response" | sed '$d')
|
||||
@@ -157,6 +143,7 @@ jobs:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||
GITEA_REF_NAME: ${{ gitea.ref_name }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
RELEASE_ID=$(cat release-id.txt)
|
||||
|
||||
Reference in New Issue
Block a user