Skip to content

Compile AutoHotkey Scripts #1

Compile AutoHotkey Scripts

Compile AutoHotkey Scripts #1

Workflow file for this run

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"
}