Skip to content

Commit

Permalink
Revert "ci: send debug and release build"
Browse files Browse the repository at this point in the history
This reverts commit 2a9498e.
  • Loading branch information
luvletter2333 committed Mar 28, 2023
1 parent 8fd846b commit 0e1c84f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
28 changes: 3 additions & 25 deletions .github/scripts/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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__':
Expand All @@ -175,12 +155,10 @@ def sendCIRelease():
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")

3 changes: 1 addition & 2 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 0e1c84f

Please sign in to comment.