diff --git a/.github/scripts/upload.py b/.github/scripts/upload.py index 417af05d2..05e158052 100644 --- a/.github/scripts/upload.py +++ b/.github/scripts/upload.py @@ -79,22 +79,6 @@ def sendDocument(user_id, path, message = "", entities = None): 'caption_entities': entities} response = requests.post(API_PREFIX + "sendDocument", files=files, data=data) print(response.json()) - return response.json() - - -def sendMediaGroup(user_id, file_ids, message, entities = None): - data = { - "chat_id": user_id, - "media": [], - "type": "media" - } - for fileid in file_ids: - data["media"].append({"type" : "document", "media" : fileid}) - data["media"][0]["caption"] = message - data["media"][0]["caption_entities"] = entities - result = requests.post(API_PREFIX + "sendMediaGroup", json=data).json() - print(result) - return result def sendRelease(): @@ -149,15 +133,11 @@ def sendRelease(): def sendCIRelease(): apks = os.listdir(APK_FOLDER) apks.sort() - file_ids = list() - for apk in apks: - apk_path = os.path.join(APK_FOLDER, apk) - result = sendDocument("@test_channel_nekox", path=apk_path) - file_ids.append(result["result"]["document"]["file_id"]) + apk = os.path.join(APK_FOLDER, apks[0]) entities = [] message = f"CI Build\n\n{COMMIT_MESSAGE}\n\n" message += addEntity(entities, message, "text_link", COMMIT_HASH[0:8], f"https://github.com/NekoX-Dev/NekoX/commit/{COMMIT_HASH}") - sendMediaGroup(CI_CHANNEL_ID, file_ids, message=message, entities=entities) + sendDocument(user_id=CI_CHANNEL_ID, path = apk, message=message, ) if __name__ == '__main__': @@ -175,12 +155,10 @@ if __name__ == '__main__': CI_CHANNEL_ID = BOT_TARGET sendCIRelease() elif mode == "debug": - CI_CHANNEL_ID = "@test_channel_nekox" APK_CHANNEL_ID = "@test_channel_nekox" UPDATE_CHANNEL_ID = "@test_channel_nekox" UPDATE_METADATA_CHANNEL_ID = "@test_channel_nekox" - sendCIRelease() - # sendRelease() + sendRelease() else: print("unknown mode") diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index 271b90f19..998d50e90 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -440,9 +440,8 @@ jobs: export DEBUG_BUILD=true export NATIVE_TARGET=universal ./gradlew TMessagesProj:assembleMiniRelease - ./gradlew TMessagesProj:assembleMiniDebug - APK=$(find TMessagesProj/build/outputs/apk/mini/ -name 'NekoX*.apk') + APK=$(find TMessagesProj/build/outputs/apk/mini/release -name 'NekoX*.apk') echo "APK=$APK" >> $GITHUB_ENV VERSION_CODE=$(grep -E "def verCode = ([0-9]+)" TMessagesProj/build.gradle | sed "s/def verCode = //") VERSION_NAME=$(grep -E "def verName = " TMessagesProj/build.gradle | sed "s/def verName = //" | sed "s/\"//g")