mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-22 05:55:38 +00:00
TEST: tesing main release on Gitea [skip ci]
This commit is contained in:
parent
af90d94c79
commit
0e8d4aba12
21
.github/workflows/main-gitea.yml
vendored
21
.github/workflows/main-gitea.yml
vendored
|
@ -135,20 +135,23 @@ jobs:
|
||||||
ORGANIZATION="RetroDECK"
|
ORGANIZATION="RetroDECK"
|
||||||
REPO="RetroDECK"
|
REPO="RetroDECK"
|
||||||
GITEA_TOKEN="${{ secrets.GITEA_TRIGGER_BUILD_TOKEN }}"
|
GITEA_TOKEN="${{ secrets.GITEA_TRIGGER_BUILD_TOKEN }}"
|
||||||
RELEASE_NAME="RetroDECK ${{ env.REL_VER }}"
|
RELEASE_NAME="RetroDECK v${{ env.REL_VER }}"
|
||||||
TAG="${{ 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
|
# Create a release using curl and capture the release ID
|
||||||
release_response=$(curl -X POST \
|
release_response=$(curl -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"$RELEASE_NAME\",\"body\":\"$escaped_body\"}" \
|
-d "$payload" \
|
||||||
"http://$GITEA_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases")
|
"http://$GITEA_HOST/api/v1/repos/$ORGANIZATION/$REPO/releases"
|
||||||
|
)
|
||||||
echo -e "[DEBUG] Release response:\n$release_response"
|
|
||||||
|
|
||||||
# Extract the release ID from the response
|
# Extract the release ID from the response
|
||||||
release_id=$(echo $release_response | jq -r '.id')
|
release_id=$(echo $release_response | jq -r '.id')
|
||||||
|
|
Loading…
Reference in a new issue