Skip to content
This repository was archived by the owner on Aug 10, 2025. It is now read-only.

Commit 8ae76d0

Browse files
authored
Add ahk compiler to release(#4)
1 parent 18826f5 commit 8ae76d0

File tree

5 files changed

+89
-1
lines changed

5 files changed

+89
-1
lines changed

.github/actions/ahk2exe/action.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Ahk2Exe
2+
description: GitHub Action to compile AutoHotKey scripts using Ahk2Exe
3+
author: nekocodeX, modified for AHK v2 by jaredkotoff
4+
5+
inputs:
6+
in:
7+
description: The path or file name of the AutoHotKey script to compile (without the .ahk extension)
8+
required: true
9+
out:
10+
description: The path or file name of the compiled executable (by default, an executable of the same name will be created in the path of the AutoHotKey script specified by the "in" parameter)
11+
required: false
12+
default: ''
13+
icon:
14+
description: The icon of the executable file is specified
15+
required: false
16+
default: ''
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- name: Get Vars
22+
id: get-vars
23+
shell: pwsh
24+
run: |
25+
$in_name = "${{inputs.in}}.ahk"
26+
$out_name = "${{inputs.in}}"
27+
if ('${{inputs.out}}' -ne '') {
28+
$out_name = "${{inputs.out}}"
29+
}
30+
$icon_param = ""
31+
if ('${{inputs.icon}}' -ne '') {
32+
$icon_param = ' /icon "${{inputs.icon}}"'
33+
}
34+
35+
- name: Extract Ahk2Exe
36+
id: extract-ahk2exe
37+
shell: pwsh
38+
run: |
39+
$cwd = (Get-Item .).FullName;
40+
Expand-Archive -Path "$cwd\.github\actions\ahk2exe\ahk2exe-v1.1.35.00.zip" -DestinationPath "$cwd\_autohotkey\" -Force;
41+
Write-Output ("$cwd\_autohotkey\;" + "$cwd\_autohotkey\Compiler") | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
42+
43+
- name: Run Ahk2Exe_64-bit
44+
id: build-64bit
45+
shell: pwsh
46+
run: Ahk2exe.exe /base "$cwd\_autohotkey\Compiler\AutoHotkey64.exe" /in "$in_name" /out "$out_name"_64-bit.exe "$icon_param" /silent verbose
47+
48+
- name: Run Ahk2Exe_32-bit
49+
id: build-32bit
50+
shell: pwsh
51+
run: Ahk2exe.exe /base "$cwd\_autohotkey\Compiler\AutoHotkey32.exe" /in "$in_name" /out "$out_name"_32-bit.exe "$icon_param" /silent verbose
52+
53+
branding:
54+
color: green
55+
icon: terminal
1.85 MB
Binary file not shown.

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Ahk2Exe
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
11+
jobs:
12+
Ahk2Exe:
13+
name: Ahk2Exe
14+
runs-on: windows-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
19+
- name: Ahk2Exe
20+
uses: ./.github/actions/ahk2exe
21+
with:
22+
in: AFB
23+
24+
- name: Release
25+
uses: softprops/action-gh-release@v1
26+
if: startsWith(github.ref, 'refs/tags/')
27+
with:
28+
files: |
29+
AFB_64-bit.exe
30+
AFB_32-bit.exe
31+
AFB.ahk
32+
env:
33+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.exe

afb.ahk renamed to AFB.ahk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#SingleInstance Force
22

33
isRunning := false
4-
Return
54

65
#MaxThreadsPerHotkey 2
76
F1:: {

0 commit comments

Comments
 (0)