Skip to content

Commit ee24bd2

Browse files
committed
tests
1 parent 4fcc2f8 commit ee24bd2

File tree

2 files changed

+28
-85
lines changed

2 files changed

+28
-85
lines changed

.github/workflows/hash-files.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
name: Create Hashes
1+
name: Update Items
22

33
on:
4-
workflow_run:
5-
workflows: ["Update Items"]
6-
types:
7-
- completed
4+
push:
5+
branches:
6+
- main
87

98
jobs:
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
@@ -47,9 +65,7 @@ jobs:
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)

.github/workflows/update-items.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)