Skip to content

Commit f555713

Browse files
Astroiteclaude
andcommitted
ci: route releases and Tauri updater through Tencent COS global acceleration
Upload source archives and Windows installer artifacts to the COS bucket under releases/<version>/, and overwrite releases/latest.json on each release so the auto-updater pulls from the accelerated edge instead of GitHub. Co-Authored-By: Claude Opus 4.7 <[email protected]>
1 parent 3169150 commit f555713

2 files changed

Lines changed: 41 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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"

frontend/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"updater": {
4040
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEM1NjgzMkVDM0UzQjMyODQKUldTRU1qcys3REpveFFIby9BS0xhNnBGMjhMN3R1WEgxOEV5cTBoTmFjY3VyWEo4OE1ISmtjdXAK",
4141
"endpoints": [
42-
"https://github.com/Astroite/MAI/releases/latest/download/latest.json"
42+
"https://agent-mai-1255740528.cos.accelerate.myqcloud.com/releases/latest.json"
4343
]
4444
}
4545
}

0 commit comments

Comments
 (0)