-
Notifications
You must be signed in to change notification settings - Fork 41
41 lines (35 loc) · 1.12 KB
/
mirrorchyan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: mirrorchyan
on:
push:
branches:
- "main"
paths:
- ".github/workflows/mirrorchyan.yml"
- ".github/version.py"
- "resource/**"
workflow_dispatch:
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Version Name
id: version_name
run: |
version=$(python .github/version.py resource/version.json)
echo "version=$version" | tee -a "$GITHUB_OUTPUT"
- name: Zip
id: zip
run: |
mkdir MirrorChyan
zip -r MirrorChyan/${{ github.event.repository.name }}.zip resource
- uses: actions/upload-artifact@v4
with:
name: MirrorChyan
path: MirrorChyan
- 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.version_name.outputs.version }}"' \
--form 'file=@"MirrorChyan/${{ github.event.repository.name }}.zip"'