|
|
|
|
@@ -208,31 +208,41 @@ jobs:
|
|
|
|
|
- name: 🚀 Create Gitea Release
|
|
|
|
|
if: steps.check_commits.outputs.commit_count != '0'
|
|
|
|
|
id: create_release
|
|
|
|
|
env:
|
|
|
|
|
CHANGELOG_LIST: ${{ steps.changed_files.outputs.CHANGED }}
|
|
|
|
|
run: |
|
|
|
|
|
TAG_NAME="v${{ steps.version.outputs.VERSION }}"
|
|
|
|
|
RELEASE_NAME="${{ steps.version.outputs.REPO_NAME }} v${{ steps.version.outputs.VERSION }}"
|
|
|
|
|
# Construct Markdown body with real newlines
|
|
|
|
|
BODY="$(printf "### Changelog\nFiles changed in this release:\n%s" "${{ steps.changed_files.outputs.CHANGED }}")"
|
|
|
|
|
|
|
|
|
|
# Create JSON payload using jq to ensure proper escaping
|
|
|
|
|
# Construct Markdown body safely using env var
|
|
|
|
|
# We use printf to avoid interpreting backslashes in the file list
|
|
|
|
|
BODY=$(printf "### Changelog\nFiles changed in this release:\n%s" "$CHANGELOG_LIST")
|
|
|
|
|
|
|
|
|
|
# Create JSON payload using jq
|
|
|
|
|
jq -n \
|
|
|
|
|
--arg tag_name "$TAG_NAME" \
|
|
|
|
|
--arg name "$RELEASE_NAME" \
|
|
|
|
|
--arg body "$BODY" \
|
|
|
|
|
'{tag_name: $tag_name, name: $name, body: $body, draft: false, prerelease: false}' > release_payload.json
|
|
|
|
|
|
|
|
|
|
echo "DEBUG: Generated Payload:"
|
|
|
|
|
cat release_payload.json
|
|
|
|
|
|
|
|
|
|
# Create Release
|
|
|
|
|
RESPONSE=$(curl -s -X POST "${{ gitea.api_url }}/repos/${{ gitea.repository }}/releases" \
|
|
|
|
|
curl -s -X POST "${{ gitea.api_url }}/repos/${{ gitea.repository }}/releases" \
|
|
|
|
|
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
|
-d @release_payload.json)
|
|
|
|
|
-d @release_payload.json > api_response.json
|
|
|
|
|
|
|
|
|
|
RELEASE_ID=$(echo "$RESPONSE" | jq -r .id)
|
|
|
|
|
echo "DEBUG: API Response:"
|
|
|
|
|
cat api_response.json || true
|
|
|
|
|
|
|
|
|
|
RELEASE_ID=$(jq -r .id api_response.json)
|
|
|
|
|
echo "RELEASE_ID=$RELEASE_ID" >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
|
|
|
|
if [ "$RELEASE_ID" == "null" ]; then
|
|
|
|
|
echo "Failed to create release. Response:"
|
|
|
|
|
echo "$RESPONSE"
|
|
|
|
|
if [ "$RELEASE_ID" == "null" ] || [ -z "$RELEASE_ID" ]; then
|
|
|
|
|
echo "Failed to create release. Response content:"
|
|
|
|
|
cat api_response.json
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
@@ -268,6 +278,10 @@ jobs:
|
|
|
|
|
username: ${{ gitea.actor }}
|
|
|
|
|
password: ${{ secrets.CR_PAT }}
|
|
|
|
|
|
|
|
|
|
- name: 🛠 Set up QEMU
|
|
|
|
|
if: steps.check_commits.outputs.commit_count != '0' && steps.dockerfile_check.outputs.exists == 'true'
|
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
|
|
|
|
|
|
- name: 🛠 Set up Docker Buildx
|
|
|
|
|
if: steps.check_commits.outputs.commit_count != '0' && steps.dockerfile_check.outputs.exists == 'true'
|
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
@@ -277,6 +291,7 @@ jobs:
|
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
|
with:
|
|
|
|
|
context: .
|
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
|
push: true
|
|
|
|
|
tags: |
|
|
|
|
|
git.icc.gg/${{ gitea.repository }}:latest
|
|
|
|
|
|