Compile AutoHotkey Scripts #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Compile AutoHotkey Scripts | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| create_release: | |
| permissions: | |
| contents: write | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Compile all .ahk scripts in the root | |
| shell: pwsh | |
| run: | | |
| $compiler = ".\compiler\Ahk2Exe.exe" | |
| $base = Resolve-Path ".\compiler\AutoHotkeySC.bin" | |
| if (!(Test-Path $compiler)) { | |
| Write-Error "Ahk2Exe.exe not found at $compiler" | |
| exit 1 | |
| } else { | |
| Write-Host "Found Ahk2Exe.exe at $compiler" | |
| } | |
| New-Item -ItemType Directory -Path .\dist -Force | Out-Null | |
| $outputDir = Resolve-Path -Path ".\dist" | |
| Get-ChildItem -Path . -Filter *.ahk | ForEach-Object { | |
| $input = $_.FullName | |
| $output = Join-Path -Path $outputDir -ChildPath "$($_.BaseName).exe" | |
| Write-Host "Compiling $input -> $output" | |
| & "$compiler" /in "$input" /out "$output" /base "$base" | |
| if (!(Test-Path $output)) { | |
| Write-Error "ERROR: Compilation failed — output not created: $output" | |
| exit 1 | |
| } else { | |
| Write-Host "✅ Compiled successfully: $output" | |
| } | |
| } | |
| Write-Host "Compiled files:" | |
| Get-ChildItem -Path $outputDir.Path | |
| - name: Create github release | |
| # You may pin to the exact commit or the version. | |
| # uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 | |
| uses: softprops/action-gh-release@v2.0.5 | |
| with: | |
| tag_name: v1.0.0 | |
| files: | | |
| dist/*.exe | |
| name: AutoHotkey Scripts |