Skip to content

Commit 8b46595

Browse files
committed
change to crc32
1 parent 9030a62 commit 8b46595

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

.github/workflows/hash-files.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,42 @@ on:
88
jobs:
99
hash-files:
1010
runs-on: windows-latest
11-
steps:
11+
steps:
12+
- name: Fetch Simba 2 download URL
13+
id: simba-url
14+
run: |
15+
$url = "https://raw.githubusercontent.com/Villavu/Simba-Build-Archive/refs/heads/main/latest.win64"
16+
$response = Invoke-WebRequest -Uri $url -UseBasicParsing
17+
$baseUrl = $response.Content.Trim() -replace 'Win64\.zip\?raw=true$', ''
18+
Write-Output "Base URL: $baseUrl"
19+
echo "::set-output name=baseUrl::$baseUrl"
20+
New-Item -Path ".\Includes" -ItemType Directory
21+
22+
- name: Download Simba 2.0 (64-bit)
23+
run: |
24+
$baseUrl = "${{ steps.simba-url.outputs.baseUrl }}"
25+
$downloadUrl = "$baseUrl" + "Win64.zip?raw=true"
26+
Write-Output "Download URL (64-bit): $downloadUrl"
27+
$outputFile = ".\download.zip"
28+
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile
29+
Expand-Archive -Path $outputFile -DestinationPath . -Force
30+
Remove-Item -Path $outputFile -Force
31+
1232
- name: Checkout repository
1333
uses: actions/[email protected]
34+
with:
35+
path: ./wasp-data
1436

1537
- name: Hash all eligible files
1638
shell: bash
1739
run: |
18-
shopt -s globstar
19-
for file in **/*; do
20-
[ -d "$file" ] && continue
21-
22-
[[ "$file" == .git/* || "$file" == .github/* || "$file" == tools/* ]] && continue
23-
[[ "$file" == "LICENSE" || "$file" == "README.md" ]] && continue
24-
[[ "$file" == *.hash ]] && continue
25-
26-
HASH=$(cksum "$file" | awk '{ print $1 }')
27-
echo "$HASH" > "$file.hash"
28-
done
40+
ls -a
41+
./Simba-Win64.exe --run ./wasp-data/tools/hash-files.simba
2942
3043
- name: Commit hash files
3144
shell: bash
3245
run: |
46+
cd ./wasp-data
3347
git config --global user.name "Wasp Bot"
3448
git config --global user.email "[email protected]"
3549

tools/hash-files.simba

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ begin
1616
if files[i].EndsWith('.simba') then Continue;
1717
if SKIP.Contains(files[i]) then Continue;
1818

19-
hash := HashFile(EHashAlgo.MD5, files[i]);
19+
hash := HashFile(EHashAlgo.CRC32, files[i]);
2020
FileDelete(files[i] + '.hash');
2121
FileWrite(files[i] + '.hash', hash);
2222
WriteLn('File: ', PathExtractName(files[i]), ' Hash: ', hash);

0 commit comments

Comments
 (0)