mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
feat: bypass update resources in formatting cases (#11867)
This commit is contained in:
48
.github/workflows/res-update-game.yml
vendored
48
.github/workflows/res-update-game.yml
vendored
@@ -124,10 +124,47 @@ jobs:
|
||||
path: ./excel
|
||||
compression-level: 0
|
||||
|
||||
original-json:
|
||||
if: github.repository_owner == 'MaaAssistantArknights'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Initializization
|
||||
run: |
|
||||
urls=(
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/.prettierrc|.prettierrc"
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/tools/TaskSorter/TaskSorter.py|TaskSorter.py"
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/resource/tasks.json|tasks.json"
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/resource/global/txwy/resource/tasks.json|original/txwy.json"
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/resource/global/YoStarEN/resource/tasks.json|original/YoStarEN.json"
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/resource/global/YoStarJP/resource/tasks.json|original/YoStarJP.json"
|
||||
"https://raw.githubusercontent.com/MaaAssistantArknights/MaaAssistantArknights/refs/heads/${{ github.ref_name }}/resource/global/YoStarKR/resource/tasks.json|original/YoStarKR.json"
|
||||
)
|
||||
|
||||
mkdir -p original
|
||||
|
||||
printf "%s\n" "${urls[@]}" | xargs -P 6 -I {} bash -c '
|
||||
url=$(echo "{}" | cut -d"|" -f1)
|
||||
filename=$(echo "{}" | cut -d"|" -f2)
|
||||
curl -s -o "$filename" "$url" && echo "Downloaded $filename" || echo "Failed to download $filename" >&2
|
||||
'
|
||||
python3 TaskSorter.py --cn tasks.json --overseas EN:original/YoStarEN.json,JP:original/YoStarJP.json,KR:original/YoStarKR.json,TW:original/txwy.json
|
||||
|
||||
- name: Prettify original JSON
|
||||
uses: Nerixyz/actionsx-prettier@v3-adj
|
||||
with:
|
||||
args: -w original/YoStarEN.json original/YoStarJP.json original/YoStarKR.json original/txwy.json
|
||||
|
||||
- name: Upload Original
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: original
|
||||
path: ./original
|
||||
compression-level: 0
|
||||
|
||||
update-game-resources:
|
||||
# In case of rate limitations on the runners/instances, add dependency, by removing the comment
|
||||
|
||||
# needs: [clone-resources-official, clone-resources-overseas, clone-resources-txwy]
|
||||
# needs: [clone-resources-official, clone-resources-overseas, clone-resources-txwy, original-json]
|
||||
if: github.repository_owner == 'MaaAssistantArknights'
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
@@ -183,6 +220,13 @@ jobs:
|
||||
./tools/ResourceUpdater/x64/Release/opencv_world4_maa.dll
|
||||
./tools/ResourceUpdater/x64/Release/ResourceUpdater.exe
|
||||
|
||||
- name: Download original JSON
|
||||
id: download-original
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
with:
|
||||
name: original
|
||||
path: ./original
|
||||
|
||||
- name: Download txwy
|
||||
id: download-txwy
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
@@ -324,7 +368,7 @@ jobs:
|
||||
github_token: ${{ secrets.MAA_RESOURCE_SYNC }}
|
||||
|
||||
- name: Update OTA resource
|
||||
if: steps.add_files.outputs.have_commits == 'True'
|
||||
if: steps.add_files.outputs.update_resources == 'True'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.MAA_RESOURCE_SYNC }}
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user