ci: modify release

This commit is contained in:
NextAlone 2022-03-01 00:36:03 +08:00
parent 4f0bf06065
commit bec321d1a1
No known key found for this signature in database
GPG Key ID: DBA7B0AEF8C1CD2C

View File

@ -23,9 +23,6 @@ jobs:
permission: "write" permission: "write"
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Modify modules"
run: |
sed -i 's/\/\///g' settings.gradle
ffmpeg: ffmpeg:
name: Native Build (FFmpeg) name: Native Build (FFmpeg)
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -360,25 +357,22 @@ jobs:
-F chat_id="${{ secrets.TELEGRAM_CHANNEL }}" \ -F chat_id="${{ secrets.TELEGRAM_CHANNEL }}" \
-F text="==== Release ====" \ -F text="==== Release ====" \
--silent --show-error --fail >/dev/null --silent --show-error --fail >/dev/null
mkdir apks
find artifacts -name "*.apk" -exec cp {} apks \; # send media group via telegram bot api
function upload() { export mini64=$(find artifacts -name "*mini-arm64-v8a-release.apk")
for apk in $@; do export mini32=$(find artifacts -name "*mini-armeabi-v7a-release.apk")
echo ">> Uploading $apk" export full64=$(find artifacts -name "*full-arm64-v8a-release.apk")
curl http://127.0.0.1:8081/bot${{ secrets.TELEGRAM_TOKEN }}/sendDocument \ export full32=$(find artifacts -name "*full-armeabi-v7a-release.apk")
-X POST \
-F chat_id="${{ secrets.TELEGRAM_CHANNEL }}" \ curl -v "http://127.0.0.1:8081/bot${{ secrets.TELEGRAM_TOKEN }}/sendMediaGroup?chat_id=${{ secrets.TELEGRAM_CHANNEL }}&media=%5B%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2Fmini64%22%7D%2C%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2Fmini32%22%7D%2C%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2Ffull64%22%7D%2C%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2Ffull32%22%7D%5D" \
-F document="@$apk" \ -F mini64="@$mini64" \
--retry 5 \ -F mini32="@$mini32" \
--retry-delay 5 \ -F full64="@$full64" \
--silent --show-error --fail >/dev/null -F full32="@$full32" \
sleep 1 --retry 5 \
done --retry-delay 5 \
} --silent --show-error --fail >/dev/null
upload apks/NekoX-*-mini-arm64-v8a-release.apk
upload apks/NekoX-*-mini-armeabi-v7a-release.apk
upload apks/NekoX-*-full-arm64-v8a-release.apk
upload apks/NekoX-*-full-armeabi-v7a-release.apk
pkill telegram-bot pkill telegram-bot
telegram-bot-api: telegram-bot-api:
name: Telegram Bot API name: Telegram Bot API
@ -414,4 +408,4 @@ jobs:
uses: actions/upload-artifact@master uses: actions/upload-artifact@master
with: with:
name: telegram-bot-api-binary name: telegram-bot-api-binary
path: telegram-bot-api-binary path: telegram-bot-api-binary