forked from AG_QGIS/Plugin_Test_Action
.gitea/workflows/release.yml aktualisiert
This commit is contained in:
@@ -136,35 +136,32 @@ jobs:
|
|||||||
# Nur fürs Log:
|
# Nur fürs Log:
|
||||||
echo "ZIP_NAME=${ZIP_NAME}"
|
echo "ZIP_NAME=${ZIP_NAME}"
|
||||||
|
|
||||||
- name: Check if release exists
|
|
||||||
id: check_release
|
|
||||||
run: |
|
|
||||||
RESPONSE=$(curl -s \
|
|
||||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
|
||||||
"https://${{ vars.RELEASE_URL }}/api/v1/repos/${{ github.repository }}/releases/tags/${{ github.ref_name }}")
|
|
||||||
|
|
||||||
echo "response=$RESPONSE" >> $GITHUB_OUTPUT
|
|
||||||
echo "Check response: $RESPONSE"
|
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
id: create_release
|
id: create_release
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.info.outputs.version }}"
|
echo "Kommuniziere mit Gitea API über HTTPS..."
|
||||||
IS_PRERELEASE=true
|
API_RESPONSE=$(curl -s -k -X POST "https://${{ vars.RELEASE_URL }}/api/v1/repos/${{ github.repository }}/releases" \
|
||||||
[[ "${{ steps.info.outputs.channel }}" == "stable" ]] && IS_PRERELEASE=false
|
-H "accept: application/json" \
|
||||||
|
|
||||||
RESPONSE=$(curl -s -X POST \
|
|
||||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
"https://${{ vars.RELEASE_URL }}/api/v1/repos/${{ github.repository }}/releases" \
|
-d '{
|
||||||
-d "{
|
"body": "Dieses Release wurde automatisch vom Gitea Runner erstellt.",
|
||||||
\"tag_name\": \"${{ github.ref_name }}\",
|
"draft": false,
|
||||||
\"name\": \"Release ${VERSION}\",
|
"name": "Version ${{ github.ref_name }}",
|
||||||
\"prerelease\": ${IS_PRERELEASE}
|
"prerelease": false,
|
||||||
}")
|
"tag_name": "${{ github.ref_name }}"
|
||||||
|
}')
|
||||||
|
|
||||||
RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
RELEASE_ID=$(echo $API_RESPONSE | jq -r '.id')
|
||||||
echo "release_id=${RELEASE_ID}" >> $GITHUB_OUTPUT
|
|
||||||
|
if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then
|
||||||
|
echo "Fehler beim Erstellen des Releases. API Antwort:"
|
||||||
|
echo $API_RESPONSE
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Release ID: $RELEASE_ID"
|
||||||
|
echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Upload ZIP asset
|
- name: Upload ZIP asset
|
||||||
id: upload_asset
|
id: upload_asset
|
||||||
|
|||||||
Reference in New Issue
Block a user