Compile AutoHotkey Scripts #1
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: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Install AutoHotkey | |
| run: | | |
| Invoke-WebRequest -Uri https://www.autohotkey.com/download/ahk-install.exe -OutFile ahk-install.exe | |
| Start-Process -Wait -FilePath .\ahk-install.exe -ArgumentList "/S" | |
| - name: Compile all .ahk scripts in the root | |
| shell: pwsh | |
| run: | | |
| $compiler = "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" | |
| if (!(Test-Path $compiler)) { | |
| Write-Error "Ahk2Exe.exe not found at $compiler" | |
| exit 1 | |
| } | |
| Get-ChildItem -Path . -Filter *.ahk | ForEach-Object { | |
| $input = $_.FullName | |
| $output = "$($_.BaseName).exe" | |
| & "$compiler" /in "$input" /out "$output" | |
| } |