Skip to content

Commit

Permalink
Merge pull request #463 from MistEO/patch-1
Browse files Browse the repository at this point in the history
ci: use mirrorchyan uploading action
  • Loading branch information
moesnow authored Feb 10, 2025
2 parents aca1195 + ea884cd commit 1a97d81
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/1.build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,10 @@ jobs:
./dist/March7thAssistant_${{ github.ref_name }}_full.7z
./dist/March7thAssistant_${{ github.ref_name }}.7z
prerelease: true

# 步骤10:强制触发 MirrorChyan 上传
- name: Trigger MirrorChyanUploading
run: |
gh workflow run --repo $GITHUB_REPOSITORY 4.upload_mirrorchyan
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 10 additions & 20 deletions .github/workflows/4.upload_mirrorchyan.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
name: Upload Release to MirrorChyan
name: MirrorChyan Uploading

# 触发条件:手动触发或版本发布后
on:
workflow_dispatch:
release:
types: [published]

jobs:
mirrorchyan:
runs-on: macos-latest

steps:
# 下载 Release 包
- name: Download Release
uses: robinraju/release-downloader@v1
id: download
- id: uploading
uses: MirrorChyan/uploading-action@v1
with:
repository: moesnow/March7thAssistant
fileName: "*full.zip"
latest: true
out-file-path: "downloads"
extract: false
filetype: latest-release
filename: "*full.zip"
mirrorchyan_rid: March7thAssistant

# 上传到 Mirror酱
- name: Upload to MirrorChyan
run: |
curl --location --request POST 'https://mirrorc.top/api/resources/${{ github.event.repository.name }}/versions' \
--header 'Authorization:${{ secrets.MirrorChyanUploadToken }}' \
--form 'name="${{steps.download.outputs.tag_name}}"' \
--form 'file=@"${{ fromJson(steps.download.outputs.downloaded_files)[0] }}"'
github_token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
upload_token: ${{ secrets.MirrorChyanUploadToken }}

0 comments on commit 1a97d81

Please sign in to comment.