Debug release creation
This commit is contained in:
@@ -34,19 +34,32 @@ jobs:
|
|||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
run: |
|
run: |
|
||||||
|
set -x
|
||||||
TAG_NAME=${GITHUB_REF#refs/tags/}
|
TAG_NAME=${GITHUB_REF#refs/tags/}
|
||||||
APK_FILE=$(ls app/build/outputs/apk/release/*.apk | head -1)
|
APK_FILE=$(ls app/build/outputs/apk/release/*.apk | head -1)
|
||||||
|
|
||||||
# Create release via API
|
echo "Tag: $TAG_NAME"
|
||||||
curl -X POST "https://git-dangilcal.duckdns.org/api/v1/repos/dangilcal/Helldivers-app-movil/releases" \
|
echo "APK: $APK_FILE"
|
||||||
|
echo "Token exists: ${{ secrets.GITHUB_TOKEN != '' }}"
|
||||||
|
|
||||||
|
TOKEN=${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# Create release
|
||||||
|
RELEASE_JSON=$(curl -s -X POST "https://git-dangilcal.duckdns.org/api/v1/repos/dangilcal/Helldivers-app-movil/releases" \
|
||||||
-H "accept: application/json" \
|
-H "accept: application/json" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
-H "Authorization: token $TOKEN" \
|
||||||
-d "{\"tag_name\": \"$TAG_NAME\", \"name\": \"Release $TAG_NAME\", \"draft\": false, \"prerelease\": false}"
|
-d "{\"tag_name\": \"$TAG_NAME\", \"name\": \"Release $TAG_NAME\", \"draft\": false, \"prerelease\": false}")
|
||||||
|
|
||||||
|
echo "Release created: $RELEASE_JSON"
|
||||||
|
|
||||||
|
RELEASE_ID=$(echo $RELEASE_JSON | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||||
|
|
||||||
|
echo "Release ID: $RELEASE_ID"
|
||||||
|
|
||||||
# Upload asset
|
# Upload asset
|
||||||
curl -X POST "https://git-dangilcal.duckdns.org/api/v1/repos/dangilcal/Helldivers-app-movil/releases/tags/$TAG_NAME/assets" \
|
curl -v -X POST "https://git-dangilcal.duckdns.org/api/v1/repos/dangilcal/Helldivers-app-movil/releases/$RELEASE_ID/assets" \
|
||||||
-H "accept: application/json" \
|
-H "accept: application/json" \
|
||||||
-H "Content-Type: multipart/form-data" \
|
-H "Content-Type: multipart/form-data" \
|
||||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
-H "Authorization: token $TOKEN" \
|
||||||
-F "attachment=@$APK_FILE"
|
-F "attachment=@$APK_FILE"
|
||||||
|
|||||||
Reference in New Issue
Block a user