From 0e8d4aba127ead76b62ed39716bea1a8285238fb Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 22 Apr 2024 22:28:10 +0900 Subject: [PATCH] TEST: tesing main release on Gitea [skip ci] --- .github/workflows/main-gitea.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main-gitea.yml b/.github/workflows/main-gitea.yml index 88a8c10e..0c163bc7 100644 --- a/.github/workflows/main-gitea.yml +++ b/.github/workflows/main-gitea.yml @@ -135,20 +135,23 @@ jobs: ORGANIZATION="RetroDECK" REPO="RetroDECK" GITEA_TOKEN="${{ secrets.GITEA_TRIGGER_BUILD_TOKEN }}" - RELEASE_NAME="RetroDECK ${{ env.REL_VER }}" + RELEASE_NAME="RetroDECK v${{ env.REL_VER }}" TAG="${{ env.REL_VER }}" - RELEASE_BODY="$(cat body.md)" - escaped_body=$(echo "$RELEASE_BODY" | sed 's/[][\\.*^$]/\\&/g') + payload=$(jq -cn \ + --arg tag_name "$TAG" \ + --arg name "$RELEASE_NAME" \ + --arg body "$(cat body.md)" \ + '{$tag_name, $name, $body}' + ) # Create a release using curl and capture the release ID release_response=$(curl -X POST \ - -H "Authorization: token ${GITEA_TOKEN}" \ - -H "Content-Type: application/json" \ - -d "{\"tag_name\":\"$TAG\",\"name\":\"$RELEASE_NAME\",\"body\":\"$escaped_body\"}" \ - "http://$GITEA_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases") - - echo -e "[DEBUG] Release response:\n$release_response" + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "$payload" \ + "http://$GITEA_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases" + ) # Extract the release ID from the response release_id=$(echo $release_response | jq -r '.id')