From 89716a61e3b885980d3f8396c3842a6c474d8169 Mon Sep 17 00:00:00 2001 From: wxl0430 <141288415+wxl0430@users.noreply.github.com> Date: Sun, 20 Jul 2025 09:46:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E5=8F=8C=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/PostPackage.py | 48 +++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/tools/PostPackage.py b/tools/PostPackage.py index 0e9893e..3cfde02 100644 --- a/tools/PostPackage.py +++ b/tools/PostPackage.py @@ -1,18 +1,30 @@ -import requests -import os - -parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -zip_path = os.path.join(parent_dir, 'output.zip') - -url = os.environ['DEPLOY_URL'] -token = os.environ.get('DEPLOY_TOKEN', '') - -with open(zip_path, 'rb') as f: - r = requests.post( - url, - files={'file': f}, - headers={'Authorization': f'Bearer {token}'} - ) - -print(f"Server responded with status: {r.status_code}") -print(r.text) +import requests +import os + +parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +zip_path = os.path.join(parent_dir, 'output.zip') + +url = os.environ['DEPLOY_URL'] +token = os.environ.get('DEPLOY_TOKEN', '') +mirror_url = os.environ['MIRROR_DEPLOY_URL'] +mirror_token = os.environ.get('MIRROR_DEPLOY_TOKEN', '') + +with open(zip_path, 'rb') as f: + r = requests.post( + url, + files={'file': f}, + headers={'Authorization': f'Bearer {token}'} + ) + +with open(zip_path, 'rb') as f: + r = requests.post( + mirror_url, + files={'file': f}, + headers={'Authorization': f'Bearer {mirror_token}'} + ) + +print(f"Server responded with status: {r.status_code}") +print(r.text) + +print(f"Mirror server responded with status: {r.status_code}") +print(r.text)