Skip to content

Commit

Permalink
Github Actions: Avoid weird bug with Powershell on Github Actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lymia committed Dec 19, 2023
1 parent 2d7fb0a commit c212d62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
- run: rm -Recurse -Force -Verbose target/mppatch_ci_natives-linux

# Do the actual build
- run: powershell -file scripts/ci/build-installer_win32.ps1
- run: pwsh -file scripts/ci/build-installer_win32.ps1

# Upload artifacts
- uses: actions/upload-artifact@v3
Expand Down
12 changes: 3 additions & 9 deletions scripts/ci/build-installer_win32.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ if (-Not(Test-Path "target/rcedit.exe" -PathType Leaf)) {
}

# Find the current version
$VERSION = "$( sbt "print version" --error )".Trim().Replace(" ", "")
$VERSION = "$( sbt "print version" --error )".Trim()
$VERSION = $VERSION.Split(" ")[0].Trim() # fix a weird Github Actions difference
$FILE_VERSION = "$VERSION".Split("-")[0]
$FILE_VERSION = "$FILE_VERSION.$( git rev-list HEAD --count )"
$INSTALLER_NAME = "MPPatch-Installer_win32_$VERSION.exe"
Expand Down Expand Up @@ -86,11 +87,4 @@ target/rcedit.exe "target/mppatch-installer-stub.exe" `
--set-version-string "OriginalFilename" "$INSTALLER_NAME" `
--set-icon "scripts/res/mppatch-installer.ico" `
--application-manifest "scripts/res/win32-manifest.xml"

if ((get-host).version.major -le 5) {
Get-Content "target/mppatch-installer-stub.exe","target\mppatch-installer-data.dat" -Encoding Byte -Read 1024 `
| Set-Content "target\$INSTALLER_NAME" -Encoding Byte
} else {
Get-Content "target/mppatch-installer-stub.exe","target\mppatch-installer-data.dat" -AsByteStream -Read 1024 `
| Set-Content "target\$INSTALLER_NAME" -AsByteStream
}
cmd /c copy /b "target\mppatch-installer-stub.exe" + "target\mppatch-installer-data.dat" "target\$INSTALLER_NAME"

0 comments on commit c212d62

Please sign in to comment.