1- name : Create Hashes
1+ name : Update Items
22
33on :
4- workflow_run :
5- workflows : ["Update Items"]
6- types :
7- - completed
4+ push :
5+ branches :
6+ - main
87
98jobs :
109 hash-files :
1110 runs-on : windows-latest
12- steps :
11+ steps :
1312 - name : Fetch Simba 2 download URL
1413 shell : powershell
1514 run : |
@@ -30,13 +29,32 @@ jobs:
3029 Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile
3130 Expand-Archive -Path $outputFile -DestinationPath . -Force
3231 Remove-Item -Path $outputFile -Force
33-
32+
3433 - name : Checkout repository
3534 uses : actions/checkout@v4.2.2
3635 with :
3736 path : ./wasp-data
38-
39- - name : Hash all eligible files
37+
38+ - name : Check if item files changed
39+ id : file_check
40+ shell : bash
41+ working-directory : ./wasp-data
42+ run : |
43+ if git diff --name-only HEAD^ HEAD | grep -q '^finders/items/data/item.txt$'; then
44+ echo "changed=true" >> $GITHUB_OUTPUT
45+ else
46+ echo "changed=false" >> $GITHUB_OUTPUT
47+ fi
48+
49+ - name : Generate new item files
50+ if : steps.file_check.outputs.changed == 'true'
51+ shell : bash
52+ run : |
53+ ls -a
54+ ./Simba-Win64.exe --extractopenssl --run ./wasp-data/tools/update_items.simba
55+ ./Simba-Win64.exe --extractopenssl --run ./wasp-data/tools/update_gear.simba
56+
57+ - name : Create hash files
4058 shell : bash
4159 run : |
4260 ./Simba-Win64.exe --extractopenssl --run ./wasp-data/tools/hash-files.simba
4765 cd ./wasp-data
4866 git config --global user.name "Wasp Bot"
4967 git config --global user.email "waspbot@waspcripts.com"
50-
51- # Only commit if there are changes
52- if [[ -n "$(git status --porcelain '*.hash')" ]]; then
68+ if [[ -n "$(git status --porcelain finders/items/data/hash.txt finders/items/masks.zip jsons/gear.json '*.hash')" ]]; then
5369 git add '*.hash'
5470 CURRENT_DATE=$(date +'%Y.%m.%d')
5571 COMMIT_HASH=$(git rev-parse --short HEAD)
0 commit comments