-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (59 loc) · 2.31 KB
/
Copy pathsync-resource.yml
File metadata and controls
66 lines (59 loc) · 2.31 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Sync Resource Directory
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
sync-resource:
runs-on: ubuntu-latest
steps:
- name: Checkout prts-plus Repository
uses: actions/checkout@v4
with:
ref: develop
path: prts-plus
ssh-key: ${{ secrets.RESOURCE_DEPLOY_KEY }}
- name: Clone Specific Directories from ArknightsGameResource
run: |
git init temporary-repo
cd temporary-repo
git remote add origin https://github.com/yuanyan3060/ArknightsGameResource.git
git config core.sparseCheckout true
echo "avatar/*" >> .git/info/sparse-checkout
git pull origin main
cd ..
mkdir -p prts-plus/resource/avatar
cp -r temporary-repo/avatar/* prts-plus/resource/avatar/
- name: Clone Specific Files from MaaAssistantArknights
run: |
git init another-temp-repo
cd another-temp-repo
git remote add origin https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
git config core.sparseCheckout true
echo "resource/Arknights-Tile-Pos/*" >> .git/info/sparse-checkout
echo "resource/tasks.json" >> .git/info/sparse-checkout
echo "resource/battle_data.json" >> .git/info/sparse-checkout
git pull origin dev
cd ..
mkdir -p prts-plus/resource/map
cp -r another-temp-repo/resource/Arknights-Tile-Pos/* prts-plus/resource/map/
cp another-temp-repo/resource/battle_data.json prts-plus/resource/
- name: Generate Mapping JSON
run: |
cd prts-plus
python script/process_overview.py
python script/process_battle_data.py
- name: Setup Git User
run: |
cd prts-plus
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git show -s
- name: Commit and Push Changes to prts-plus Repository
run: |
cd prts-plus
echo "::group::Adding resources to Git"
git add resource/
echo "::endgroup::"
git diff --staged --quiet || git commit -m "Auto update resources from ArknightsGameResource and MaaAssistantArknights"
git push origin develop