|
14 | 14 | changed: ${{ steps.file_check.outputs.changed }} |
15 | 15 | steps: |
16 | 16 | - name: Checkout repo |
17 | | - uses: actions/checkout@v4 |
| 17 | + uses: actions/checkout@v4.2.2 |
18 | 18 | with: |
19 | 19 | fetch-depth: 0 |
20 | 20 |
|
|
74 | 74 | git config --global user.email "[email protected]" |
75 | 75 | if [[ -n "$(git status --porcelain)" ]]; then |
76 | 76 | 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 | + |
| 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" |
80 | 132 | git push |
81 | 133 | else |
82 | 134 | echo "No changes to commit." |
|
0 commit comments