Try alternative release creation
All checks were successful
Build Android APK / build (push) Successful in 3m4s
All checks were successful
Build Android APK / build (push) Successful in 3m4s
This commit is contained in:
@@ -38,10 +38,12 @@ jobs:
|
|||||||
TAG_NAME=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
TAG_NAME=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
||||||
|
|
||||||
if [ -z "$TAG_NAME" ]; then
|
if [ -z "$TAG_NAME" ]; then
|
||||||
# Fallback to GITHUB_REF
|
|
||||||
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Quitar la v del tag si existe
|
||||||
|
TAG_NAME_CLEAN="${TAG_NAME#v}"
|
||||||
|
|
||||||
APK_FILE=$(ls app/build/outputs/apk/release/*.apk | head -1)
|
APK_FILE=$(ls app/build/outputs/apk/release/*.apk | head -1)
|
||||||
|
|
||||||
# Rename APK with version
|
# Rename APK with version
|
||||||
@@ -50,7 +52,6 @@ jobs:
|
|||||||
|
|
||||||
echo "=== Creating release for tag: $TAG_NAME ==="
|
echo "=== Creating release for tag: $TAG_NAME ==="
|
||||||
echo "APK file: $APK_FILE"
|
echo "APK file: $APK_FILE"
|
||||||
echo "New name: $NEW_NAME"
|
|
||||||
|
|
||||||
# Use the token from secrets
|
# Use the token from secrets
|
||||||
if [ -z "${{ secrets.GITEATOKEN }}" ]; then
|
if [ -z "${{ secrets.GITEATOKEN }}" ]; then
|
||||||
@@ -58,13 +59,19 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create release using Gitea API - use target_commitish for the tag
|
# Create release using Gitea API - Create from existing tag
|
||||||
echo "Creating release..."
|
echo "Creating release..."
|
||||||
RELEASE_RESP=$(curl -s -X POST "https://git-dangilcal.duckdns.org/api/v1/repos/dangilcal/Helldivers-app-movil/releases" \
|
RELEASE_RESP=$(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.GITEATOKEN }}" \
|
-H "Authorization: token ${{ secrets.GITEATOKEN }}" \
|
||||||
-d "{\"tag_name\": \"${TAG_NAME}\", \"target_commitish\": \"main\", \"name\": \"Release ${TAG_NAME}\", \"draft\": false, \"prerelease\": false}")
|
-d "{
|
||||||
|
\"tag_name\": \"${TAG_NAME}\",
|
||||||
|
\"name\": \"Release ${TAG_NAME_CLEAN}\",
|
||||||
|
\"body\": \"Built from tag ${TAG_NAME}\",
|
||||||
|
\"draft\": false,
|
||||||
|
\"prerelease\": false
|
||||||
|
}")
|
||||||
|
|
||||||
echo "Release response: $RELEASE_RESP"
|
echo "Release response: $RELEASE_RESP"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user