diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7079cb7..470b367 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -407,3 +407,31 @@ jobs: --title "DSH Desktop $RELEASE_TAG" \ --repo "$GITHUB_REPOSITORY" fi + - name: Mirror release assets to Tencent COS + env: + COS_SECRET_ID: ${{ secrets.COS_SECRET_ID }} + COS_SECRET_KEY: ${{ secrets.COS_SECRET_KEY }} + COS_BUCKET: ${{ vars.COS_BUCKET }} + COS_REGION: ${{ vars.COS_REGION }} + RELEASE_TAG: ${{ github.ref_name }} + run: | + set -euo pipefail + test -n "$COS_SECRET_ID" && test -n "$COS_SECRET_KEY" || { echo "::error::Missing secrets COS_SECRET_ID/COS_SECRET_KEY"; exit 1; } + test -n "$COS_BUCKET" && test -n "$COS_REGION" || { echo "::error::Missing variables COS_BUCKET/COS_REGION"; exit 1; } + curl -sSfL -o coscli https://github.com/tencentyun/coscli/releases/download/v1.0.8/coscli-v1.0.8-linux-amd64 + chmod +x coscli + cat > "$HOME/.cos.yaml" <