Skip to content

Build PS2EXE

Build PS2EXE #23

name: Build PS2EXE
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_TOKEN }}
fetch-depth: 0
- name: Install PS2EXE
shell: powershell
run: |
Install-Module -Name ps2exe -Force -Scope CurrentUser
- name: Create bin directory
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path bin
- name: Compile script
shell: powershell
run: |
Invoke-ps2exe -InputFile "run.ps1" -OutputFile "bin/gdl.exe"
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add bin/
git commit -m "Auto-compile script to exe" || exit 0
git push origin HEAD:master
- name: Prepare Release Notes
shell: powershell
run: |
$releaseNotes = @"
## Files Included
- `gdl.exe` - Main executable (DO NOT RUN THIS)
- `start.bat` - Batch file to start executable
## Installation
1. Download both `gdl.exe` and `start.bat`
2. Place both files in a folder together
3. Double-click the `start.bat` file to run the executible
## Extra Stuff
- Built on: $(Get-Date -Format "yyyy-MM-dd HH:mm:ss UTC")
- Commit: $env:GITHUB_SHA
"@
$releaseNotes | Out-File release_notes.md -Encoding UTF8
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$version = Get-Date -Format "yyyy.MM.dd"
# Create a ZIP file containing all release assets
Compress-Archive -Path "bin/gdl.exe", "bin/start.bat", "release_notes.md" -DestinationPath "release-files.zip" -Force
gh release create "v$version" `
--title "Release v$version" `
--notes-file "release_notes.md" `
"bin/gdl.exe" `
"bin/start.bat" `
"release-files.zip"