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 1/3] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E5=8F=8C?= =?UTF-8?q?=E6=9C=8D=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) From f1f460db68213551192d413d03c1771b22fa672f Mon Sep 17 00:00:00 2001 From: wxl0430 <141288415+wxl0430@users.noreply.github.com> Date: Sun, 20 Jul 2025 09:46:50 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/post.yml | 54 ++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/.github/workflows/post.yml b/.github/workflows/post.yml index 17de159..ff35cbe 100644 --- a/.github/workflows/post.yml +++ b/.github/workflows/post.yml @@ -1,26 +1,28 @@ -name: Deploy - -on: - push: - branches: [ master ] - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Install dependencies - run: | - pip install requests - pip install pyyaml - - name: Run deploy script - env: - DEPLOY_URL: ${{ secrets.DEPLOY_URL }} - DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} - run: | - python tools/MakePackage.py - python tools/PostPackage.py +name: Deploy + +on: + push: + branches: [ master ] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install dependencies + run: | + pip install requests + pip install pyyaml + - name: Run deploy script + env: + DEPLOY_URL: ${{ secrets.DEPLOY_URL }} + DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} + MIRROR_DEPLOY_URL: ${{ secrets.MIRROR_DEPLOY_URL }} + MIRROR_DEPLOY_TOKEN: ${{ secrets.MIRROR_DEPLOY_TOKEN }} + run: | + python tools/MakePackage.py + python tools/PostPackage.py From 733f763b1771c1b732ee88606f52b200358b8363 Mon Sep 17 00:00:00 2001 From: wxl0430 <141288415+wxl0430@users.noreply.github.com> Date: Sun, 20 Jul 2025 09:55:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E9=95=9C=E5=83=8F=E7=AB=99=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E8=A6=86=E7=9B=96=E5=8E=9F=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/PostPackage.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/PostPackage.py b/tools/PostPackage.py index 3cfde02..72c853a 100644 --- a/tools/PostPackage.py +++ b/tools/PostPackage.py @@ -17,7 +17,7 @@ with open(zip_path, 'rb') as f: ) with open(zip_path, 'rb') as f: - r = requests.post( + mirror_r = requests.post( mirror_url, files={'file': f}, headers={'Authorization': f'Bearer {mirror_token}'} @@ -26,5 +26,5 @@ with open(zip_path, 'rb') as f: 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) +print(f"Mirror server responded with status: {mirror_r.status_code}") +print(mirror_r.text)