mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-17 16:37:17 +02:00
feat: improve Telegram notification - upload IPA, remove redundant links, increase changelog limit
This commit is contained in:
@@ -428,24 +428,30 @@ jobs:
|
|||||||
name: android-apk
|
name: android-apk
|
||||||
path: ./release
|
path: ./release
|
||||||
|
|
||||||
|
- name: Download iOS IPA
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ios-ipa
|
||||||
|
path: ./release
|
||||||
|
|
||||||
- name: Extract changelog for version
|
- name: Extract changelog for version
|
||||||
id: changelog
|
id: changelog
|
||||||
run: |
|
run: |
|
||||||
VERSION=${{ needs.get-version.outputs.version }}
|
VERSION=${{ needs.get-version.outputs.version }}
|
||||||
VERSION_NUM=${VERSION#v}
|
VERSION_NUM=${VERSION#v}
|
||||||
|
|
||||||
# Extract changelog, limit to ~1500 chars for Telegram (4096 limit minus message overhead)
|
# Extract changelog, limit to ~2500 chars for Telegram (4096 limit minus message overhead)
|
||||||
FULL_CHANGELOG=$(sed -n "/^## \[$VERSION_NUM\]/,/^## \[/{ /^## \[$VERSION_NUM\]/d; /^## \[/d; p; }" CHANGELOG.md | sed '/^---$/d')
|
FULL_CHANGELOG=$(sed -n "/^## \[$VERSION_NUM\]/,/^## \[/{ /^## \[$VERSION_NUM\]/d; /^## \[/d; p; }" CHANGELOG.md | sed '/^---$/d')
|
||||||
|
|
||||||
if [ -z "$FULL_CHANGELOG" ]; then
|
if [ -z "$FULL_CHANGELOG" ]; then
|
||||||
CHANGELOG="See release notes on GitHub for details."
|
CHANGELOG="See release notes on GitHub for details."
|
||||||
else
|
else
|
||||||
# Take first 1500 characters, then cut at last complete line
|
# Take first 2500 characters, then cut at last complete line
|
||||||
CHANGELOG=$(echo "$FULL_CHANGELOG" | head -c 1500 | sed '$d')
|
CHANGELOG=$(echo "$FULL_CHANGELOG" | head -c 2500 | sed '$d')
|
||||||
|
|
||||||
# Check if truncated
|
# Check if truncated
|
||||||
FULL_LEN=${#FULL_CHANGELOG}
|
FULL_LEN=${#FULL_CHANGELOG}
|
||||||
if [ $FULL_LEN -gt 1500 ]; then
|
if [ $FULL_LEN -gt 2500 ]; then
|
||||||
CHANGELOG="${CHANGELOG}"$'\n\n... (see full changelog on GitHub)'
|
CHANGELOG="${CHANGELOG}"$'\n\n... (see full changelog on GitHub)'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -464,18 +470,13 @@ jobs:
|
|||||||
ARM64_APK=$(find ./release -name "*arm64*.apk" | head -1)
|
ARM64_APK=$(find ./release -name "*arm64*.apk" | head -1)
|
||||||
ARM32_APK=$(find ./release -name "*arm32*.apk" | head -1)
|
ARM32_APK=$(find ./release -name "*arm32*.apk" | head -1)
|
||||||
|
|
||||||
# Prepare message with changelog
|
# Prepare message with changelog (files uploaded separately)
|
||||||
printf '%s\n' \
|
printf '%s\n' \
|
||||||
"*SpotiFLAC ${VERSION} Released!*" \
|
"*SpotiFLAC Mobile ${VERSION} Released!*" \
|
||||||
"" \
|
"" \
|
||||||
"*What's New:*" \
|
"*What's New:*" \
|
||||||
"${CHANGELOG}" \
|
"${CHANGELOG}" \
|
||||||
"" \
|
"" \
|
||||||
"*Download:*" \
|
|
||||||
"- [arm64 APK](https://github.com/${{ github.repository }}/releases/download/${VERSION}/SpotiFLAC-${VERSION}-arm64.apk) (recommended)" \
|
|
||||||
"- [arm32 APK](https://github.com/${{ github.repository }}/releases/download/${VERSION}/SpotiFLAC-${VERSION}-arm32.apk)" \
|
|
||||||
"- [iOS IPA](https://github.com/${{ github.repository }}/releases/download/${VERSION}/SpotiFLAC-${VERSION}-ios-unsigned.ipa)" \
|
|
||||||
"" \
|
|
||||||
"[View Release Notes](https://github.com/${{ github.repository }}/releases/tag/${VERSION})" \
|
"[View Release Notes](https://github.com/${{ github.repository }}/releases/tag/${VERSION})" \
|
||||||
> /tmp/telegram_message.txt
|
> /tmp/telegram_message.txt
|
||||||
|
|
||||||
@@ -506,4 +507,14 @@ jobs:
|
|||||||
-F caption="SpotiFLAC ${VERSION} - arm32"
|
-F caption="SpotiFLAC ${VERSION} - arm32"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Upload iOS IPA to channel
|
||||||
|
IOS_IPA=$(find ./release -name "*ios*.ipa" | head -1)
|
||||||
|
if [ -f "$IOS_IPA" ]; then
|
||||||
|
echo "Uploading iOS IPA to Telegram..."
|
||||||
|
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendDocument" \
|
||||||
|
-F chat_id="${TELEGRAM_CHANNEL_ID}" \
|
||||||
|
-F document=@"${IOS_IPA}" \
|
||||||
|
-F caption="SpotiFLAC ${VERSION} - iOS (unsigned, sideload required)"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Telegram notification sent!"
|
echo "Telegram notification sent!"
|
||||||
|
|||||||
Reference in New Issue
Block a user