Skip to content

Commit

Permalink
ci: 添加上传附件到bitbucket的脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
nICEnnnnnnnLee committed Oct 29, 2023
1 parent 1e562e2 commit 1d888cd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/scripts/upload_bitbucket.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 工作目录在项目顶级
# 必须的环境变量: VERSION_NUMBER BITBUCKET_TOKEN

curl "https://api.bitbucket.org/2.0/repositories/niceleeee/BilibiliDown/downloads" \
-F "[email protected]$VERSION_NUMBER.release.zip" \
-H "Authorization: Bearer $BITBUCKET_TOKEN"

curl "https://api.bitbucket.org/2.0/repositories/niceleeee/BilibiliDown/downloads" \
-F "[email protected]$VERSION_NUMBER.release.zip.sha1" \
-H "Authorization: Bearer $BITBUCKET_TOKEN"
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,15 @@ jobs:
run: |
chmod +x .github/scripts/upload_cloudinary.sh
./.github/scripts/upload_cloudinary.sh
- name: Upload release to bitbucket
env:
VERSION_NUMBER: ${{ steps.tag_latest.outputs.value }}
BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }}
if: ${{ always() && env.BITBUCKET_TOKEN != '' && github.event.inputs.bitbucket == 'true'}}
run: |
chmod +x .github/scripts/upload_bitbucket.sh
./.github/scripts/upload_bitbucket.sh
- name: Sync Push to Gitee
env:
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/upload-manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:
type: boolean
default: true
required: false
bitbucket:
description: 'Upload to bitbucket?'
type: boolean
default: true
required: false
giteePush:
description: 'Push to gitee?'
type: boolean
Expand Down Expand Up @@ -66,7 +71,16 @@ jobs:
if: ${{ always() && env.CLOUDINARY_API_KEY != '' && env.CLOUDINARY_API_SECRET != '' && github.event.inputs.cloudinary == 'true'}}
run: |
chmod +x .github/scripts/upload_cloudinary.sh
./.github/scripts/upload_cloudinary.sh
./.github/scripts/upload_cloudinary.sh
- name: Upload release to bitbucket
env:
VERSION_NUMBER: ${{ steps.tag_latest.outputs.value }}
BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }}
if: ${{ always() && env.BITBUCKET_TOKEN != '' && github.event.inputs.bitbucket == 'true'}}
run: |
chmod +x .github/scripts/upload_bitbucket.sh
./.github/scripts/upload_bitbucket.sh
- name: Sync Push to Gitee
Expand Down

0 comments on commit 1d888cd

Please sign in to comment.