Fix release tag issue
This commit is contained in:
@@ -34,7 +34,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
run: |
|
run: |
|
||||||
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
# Get tag name from git
|
||||||
|
TAG_NAME=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
||||||
|
|
||||||
|
if [ -z "$TAG_NAME" ]; then
|
||||||
|
# Fallback to GITHUB_REF
|
||||||
|
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
||||||
|
fi
|
||||||
|
|
||||||
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
|
||||||
@@ -51,13 +58,13 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create release using Gitea API
|
# Create release using Gitea API - use target_commitish for the 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}\", \"name\": \"Release ${TAG_NAME}\", \"draft\": false, \"prerelease\": false}")
|
-d "{\"tag_name\": \"${TAG_NAME}\", \"target_commitish\": \"main\", \"name\": \"Release ${TAG_NAME}\", \"draft\": false, \"prerelease\": false}")
|
||||||
|
|
||||||
echo "Release response: $RELEASE_RESP"
|
echo "Release response: $RELEASE_RESP"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user