Skip to content

Commit d9c62c4

Browse files
committed
network stability
1 parent 5cb09ed commit d9c62c4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/release-binaries.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
jobs:
1212
build-and-release:
1313
name: Build and release Windows .exe
14-
runs-on: windows-latest
14+
runs-on: windows-2022
1515

1616
steps:
1717
- name: Checkout
@@ -105,9 +105,11 @@ jobs:
105105
Copy-Item -Path target/release/inspect_db.exe -Destination "$dist/inspect_db.exe" -Force
106106
Copy-Item -Path config.toml -Destination "$dist/config.toml" -Force
107107
Copy-Item -Path README.md -Destination "$dist/README.md" -Force
108-
# Normalize .bat to CRLF to ensure it runs on Windows
108+
# Normalize .bat to CRLF to ensure it runs on Windows (avoid double CR)
109109
$bat = Get-Content -Raw -Path unchained-run.bat
110-
$bat = $bat -replace "`n", "`r`n"
110+
$bat = $bat -replace "`r`n", "`n" # collapse CRLF to LF
111+
$bat = $bat -replace "`r", "`n" # convert stray CR to LF
112+
$bat = $bat -replace "`n", "`r`n" # expand LF to CRLF
111113
Set-Content -Path "$dist/unchained-run.bat" -Value $bat -NoNewline -Encoding ascii
112114
# Bundle a zip with exe + config + README + launcher (flattened)
113115
$zipPath = "target/release/unchained-windows-x86_64.zip"
@@ -122,8 +124,8 @@ jobs:
122124
- name: Create Release and Upload Assets (.exe)
123125
uses: softprops/action-gh-release@v2
124126
with:
125-
tag_name: ${{ steps.meta.outputs.tag }}
126-
name: ${{ steps.meta.outputs.name }}
127+
tag_name: auto-main-${{ github.sha }}
128+
name: Main build ${{ github.sha }}
127129
target_commitish: ${{ github.sha }}
128130
files: |
129131
target/release/unchained.exe
@@ -138,7 +140,7 @@ jobs:
138140
shell: pwsh
139141
run: |
140142
$short = $env:GITHUB_SHA.Substring(0,7)
141-
"tag=auto-main-$short" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
142-
"name=Main build $short" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
143+
Add-Content -Path $env:GITHUB_OUTPUT -Value "tag=auto-main-$short"
144+
Add-Content -Path $env:GITHUB_OUTPUT -Value "name=Main build $short"
143145
144146

0 commit comments

Comments
 (0)