@@ -106,6 +106,20 @@ jobs:
106106 --generate-notes
107107 fi
108108
109+ - name : Upload source artifacts to COS
110+ env :
111+ TENCENTCLOUD_SECRET_ID : ${{ secrets.TENCENT_SECRET_ID }}
112+ TENCENTCLOUD_SECRET_KEY : ${{ secrets.TENCENT_SECRET_KEY }}
113+ COS_BUCKET : ${{ secrets.COS_BUCKET }}
114+ COS_REGION : ${{ secrets.COS_REGION }}
115+ shell : bash
116+ run : |
117+ VERSION="${{ steps.version.outputs.version }}"
118+ pip install coscmd --quiet
119+ coscmd config -a "$TENCENTCLOUD_SECRET_ID" -s "$TENCENTCLOUD_SECRET_KEY" \
120+ -b "$COS_BUCKET" -r "$COS_REGION"
121+ coscmd upload -r dist-artifacts/ "releases/${VERSION}/"
122+
109123 build-windows-exe :
110124 runs-on : windows-latest
111125
@@ -206,6 +220,7 @@ jobs:
206220 VERSION="${{ steps.version.outputs.version }}"
207221 VERSION_NUMBER="${{ steps.version.outputs.version_number }}"
208222 NSIS_DIR="frontend/src-tauri/target/release/bundle/nsis"
223+ COS_BUCKET="${{ secrets.COS_BUCKET }}"
209224
210225 # Find the main installer exe
211226 INSTALLER=$(find "$NSIS_DIR" -maxdepth 1 -name "*setup.exe" | head -1)
@@ -214,7 +229,8 @@ jobs:
214229 exit 1
215230 fi
216231 INSTALLER_NAME=$(basename "$INSTALLER")
217- DOWNLOAD_URL="https://github.com/Astroite/MAI/releases/download/${VERSION}/${INSTALLER_NAME}"
232+ # Use COS global acceleration URL for the updater
233+ DOWNLOAD_URL="https://${COS_BUCKET}.cos.accelerate.myqcloud.com/releases/${VERSION}/${INSTALLER_NAME}"
218234
219235 # Read the signature from the .sig file
220236 SIG_FILE=$(find "$NSIS_DIR" -maxdepth 1 -name "*.exe.sig" | head -1)
@@ -257,3 +273,26 @@ jobs:
257273 --title "MAI $VERSION" \
258274 --generate-notes
259275 fi
276+
277+ - name : Upload installer artifacts to COS
278+ env :
279+ TENCENTCLOUD_SECRET_ID : ${{ secrets.TENCENT_SECRET_ID }}
280+ TENCENTCLOUD_SECRET_KEY : ${{ secrets.TENCENT_SECRET_KEY }}
281+ COS_BUCKET : ${{ secrets.COS_BUCKET }}
282+ COS_REGION : ${{ secrets.COS_REGION }}
283+ shell : bash
284+ run : |
285+ VERSION="${{ steps.version.outputs.version }}"
286+ NSIS_DIR="frontend/src-tauri/target/release/bundle/nsis"
287+ pip install coscmd --quiet
288+ coscmd config -a "$TENCENTCLOUD_SECRET_ID" -s "$TENCENTCLOUD_SECRET_KEY" \
289+ -b "$COS_BUCKET" -r "$COS_REGION"
290+ # Upload versioned installer files
291+ find "$NSIS_DIR" -maxdepth 1 \( -name "*setup.exe" -o -name "*.exe.sig" -o -name "*.nsis.zip" -o -name "*.nsis.zip.sig" \) \
292+ | while read -r f; do
293+ coscmd upload "$f" "releases/${VERSION}/$(basename "$f")"
294+ done
295+ # Upload latest.json to fixed path (Tauri auto-updater endpoint)
296+ coscmd upload "$NSIS_DIR/latest.json" "releases/latest.json"
297+ echo "COS upload complete. Updater endpoint:"
298+ echo " https://${COS_BUCKET}.cos.accelerate.myqcloud.com/releases/latest.json"
0 commit comments