fix: upda_items.simba was bugged #46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Files | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| hash-files: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Fetch Simba 2 download URL | |
| id: simba-url | |
| run: | | |
| $url = "https://raw.githubusercontent.com/Villavu/Simba-Build-Archive/refs/heads/main/latest.win64" | |
| $response = Invoke-WebRequest -Uri $url -UseBasicParsing | |
| $baseUrl = $response.Content.Trim() -replace 'Win64\.zip\?raw=true$', '' | |
| Write-Output "Base URL: $baseUrl" | |
| echo "::set-output name=baseUrl::$baseUrl" | |
| New-Item -Path ".\Includes" -ItemType Directory | |
| - name: Download Simba 2.0 (64-bit) | |
| run: | | |
| $baseUrl = "${{ steps.simba-url.outputs.baseUrl }}" | |
| $downloadUrl = "$baseUrl" + "Win64.zip?raw=true" | |
| Write-Output "Download URL (64-bit): $downloadUrl" | |
| $outputFile = ".\download.zip" | |
| Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile | |
| Expand-Archive -Path $outputFile -DestinationPath . -Force | |
| Remove-Item -Path $outputFile -Force | |
| - name: Checkout repository | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| path: ./wasp-data | |
| - name: Check if item files changed | |
| id: file_check | |
| shell: bash | |
| working-directory: ./wasp-data | |
| run: | | |
| if git diff --name-only HEAD^ HEAD | grep -q '^finders/items/data/item.txt$'; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Generate new item files | |
| if: steps.file_check.outputs.changed == 'true' | |
| shell: bash | |
| run: | | |
| ls -a | |
| ./Simba-Win64.exe --extractopenssl --run ./wasp-data/tools/update_items.simba | |
| ./Simba-Win64.exe --extractopenssl --run ./wasp-data/tools/update_gear.simba | |
| - name: Create hash files | |
| shell: bash | |
| run: | | |
| ./Simba-Win64.exe --extractopenssl --run ./wasp-data/tools/hash-files.simba | |
| - name: Commit hash files | |
| shell: bash | |
| run: | | |
| cd ./wasp-data | |
| git config --global user.name "Wasp Bot" | |
| git config --global user.email "waspbot@waspcripts.com" | |
| if [[ -n "$(git status --porcelain finders/items/data/hash.txt finders/items/masks.zip jsons/gear.json '*.hash')" ]]; then | |
| git add '*.hash' | |
| CURRENT_DATE=$(date +'%Y.%m.%d') | |
| COMMIT_HASH=$(git rev-parse --short HEAD) | |
| git commit -m "Automatic version bump to $CURRENT_DATE-$COMMIT_HASH" | |
| git push | |
| else | |
| echo "No hash changes to commit." | |
| fi |