Skip to content

Commit 722b41c

Browse files
committed
fix: better github action logic
1 parent bd3eaaa commit 722b41c

File tree

4 files changed

+58
-91
lines changed

4 files changed

+58
-91
lines changed

.github/workflows/hash-files.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ jobs:
4949
git config --global user.email "[email protected]"
5050
if [[ -n "$(git status --porcelain)" ]]; then
5151
git add -A
52-
CURRENT_DATE=$(date +'%Y.%m.%d')
53-
COMMIT_HASH=$(git rev-parse --short HEAD)
54-
git commit -m "Automatic version bump to $CURRENT_DATE-$COMMIT_HASH"
52+
git commit -m "Automatic hash files update"
5553
git push
5654
else
5755
echo "No changes to commit."

.github/workflows/update-gear.yml

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

.github/workflows/update-items.yml

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
changed: ${{ steps.file_check.outputs.changed }}
1515
steps:
1616
- name: Checkout repo
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v4.2.2
1818
with:
1919
fetch-depth: 0
2020

@@ -74,9 +74,61 @@ jobs:
7474
git config --global user.email "[email protected]"
7575
if [[ -n "$(git status --porcelain)" ]]; then
7676
git add -A
77-
CURRENT_DATE=$(date +'%Y.%m.%d')
78-
COMMIT_HASH=$(git rev-parse --short HEAD)
79-
git commit -m "Automatic version bump to $CURRENT_DATE-$COMMIT_HASH"
77+
git commit -m "Automatic items files update"
78+
git push
79+
else
80+
echo "No changes to commit."
81+
fi
82+
83+
84+
process-gear:
85+
if: ${{ github.repository_owner == 'WaspScripts' && needs.check-items.outputs.changed == 'true' }}
86+
needs: process-items
87+
runs-on: windows-latest
88+
steps:
89+
- name: Fetch Simba 2 download URL
90+
id: simba-url
91+
run: |
92+
$url = "https://raw.githubusercontent.com/Villavu/Simba-Build-Archive/refs/heads/main/latest.win64"
93+
$response = Invoke-WebRequest -Uri $url -UseBasicParsing
94+
$baseUrl = $response.Content.Trim() -replace 'Win64\.zip\?raw=true$', ''
95+
Write-Output "Base URL: $baseUrl"
96+
echo "::set-output name=baseUrl::$baseUrl"
97+
New-Item -Path ".\Includes" -ItemType Directory
98+
99+
- name: Download Simba 2.0 (64-bit)
100+
run: |
101+
$baseUrl = "${{ steps.simba-url.outputs.baseUrl }}"
102+
$downloadUrl = "$baseUrl" + "Win64.zip?raw=true"
103+
Write-Output "Download URL (64-bit): $downloadUrl"
104+
$outputFile = ".\download.zip"
105+
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile
106+
Expand-Archive -Path $outputFile -DestinationPath . -Force
107+
Remove-Item -Path $outputFile -Force
108+
109+
- name: Checkout repository
110+
uses: actions/[email protected]
111+
with:
112+
path: ./wasp-data
113+
fetch-depth: 2
114+
115+
- name: Generate new gear.json
116+
shell: bash
117+
run: ./Simba-Win64.exe --extractopenssl --run ./wasp-data/tools/update_gear.simba
118+
119+
- name: Create hash files
120+
shell: bash
121+
run: ./Simba-Win64.exe --extractopenssl --run ./wasp-data/tools/hash-files.simba
122+
123+
- name: Commit hash files
124+
shell: bash
125+
run: |
126+
cd ./wasp-data
127+
git config --global user.name "Wasp Bot"
128+
git config --global user.email "[email protected]"
129+
if [[ -n "$(git status --porcelain)" ]]; then
130+
git add -A
131+
git commit -m "Automatic gear files update"
80132
git push
81133
else
82134
echo "No changes to commit."

finders/items/data/item.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Dwarf remains
1+
dwarf remains
22
toolkit
33
cannonball
44
nulodion's notes

0 commit comments

Comments
 (0)