Update Hashes #37
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: Create Hashes | |
| on: | |
| workflow_run: | |
| workflows: ["Update Items"] | |
| types: | |
| - completed | |
| jobs: | |
| hash-files: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Fetch Simba 2 download URL | |
| shell: powershell | |
| 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) | |
| shell: powershell | |
| 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: Hash all eligible 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" | |
| # Only commit if there are changes | |
| if [[ -n "$(git status --porcelain '*.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 |