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

Commit e204d63

Browse files
author
Jared K
committed
fix release
1 parent 8ae76d0 commit e204d63

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

.github/actions/ahk2exe/action.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ inputs:
1010
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)
1111
required: false
1212
default: ''
13+
build_dir:
14+
description: Folder where action-gh-release can find the binaries
15+
required: false
16+
default: '_autohotkey'
1317
icon:
1418
description: The icon of the executable file is specified
1519
required: false
@@ -22,33 +26,38 @@ runs:
2226
id: get-vars
2327
shell: pwsh
2428
run: |
25-
$in_name = "${{inputs.in}}.ahk"
26-
$out_name = "${{inputs.in}}"
27-
if ('${{inputs.out}}' -ne '') {
28-
$out_name = "${{inputs.out}}"
29+
$cwd = (Get-Item .).FullName
30+
$build_dir = "$cwd\${{ inputs.build_dir }}"
31+
Add-Content -Path $env:GITHUB_ENV -Value "cwd=$cwd";
32+
Add-Content -Path $env:GITHUB_ENV -Value "build_dir=$build_dir";
33+
Add-Content -Path $env:GITHUB_ENV -Value "in_name=${{ inputs.in }}.ahk";
34+
if ('${{ inputs.out }}' -ne '') {
35+
Add-Content -Path $env:GITHUB_ENV -Value "out_name=${{ inputs.out }}";
36+
} else {
37+
Add-Content -Path $env:GITHUB_ENV -Value "out_name=${{ inputs.in }}";
2938
}
30-
$icon_param = ""
31-
if ('${{inputs.icon}}' -ne '') {
32-
$icon_param = ' /icon "${{inputs.icon}}"'
39+
if ('${{ inputs.icon }}' -ne '') {
40+
Add-Content -Path $env:GITHUB_ENV -Value "icon_param='/icon ${{ inputs.icon }}'";
41+
} else {
42+
Add-Content -Path $env:GITHUB_ENV -Value "icon_param=''";
3343
}
3444
3545
- name: Extract Ahk2Exe
3646
id: extract-ahk2exe
3747
shell: pwsh
3848
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
49+
Expand-Archive -Path "${{ env.cwd }}\.github\actions\ahk2exe\ahk2exe-v1.1.35.00.zip" -DestinationPath "${{ env.build_dir }}\" -Force;
50+
Write-Output ("${{ env.build_dir }}\;" + "${{ env.build_dir }}\Compiler") | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append;
4251
4352
- name: Run Ahk2Exe_64-bit
4453
id: build-64bit
4554
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
55+
run: Ahk2exe.exe /base "${{ env.build_dir }}\Compiler\AutoHotkey64.exe" /in ${{ env.in_name }} /out "${{ env.build_dir }}\${{ env.out_name }}_64-bit.exe" ${{ env.icon_param }} /silent verbose | Write-Output
4756

4857
- name: Run Ahk2Exe_32-bit
4958
id: build-32bit
5059
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
60+
run: Ahk2exe.exe /base "${{ env.build_dir }}\Compiler\AutoHotkey32.exe" /in ${{ env.in_name }} /out "${{ env.build_dir }}\${{ env.out_name }}_32-bit.exe" ${{ env.icon_param }} /silent verbose | Write-Output
5261

5362
branding:
5463
color: green

.github/workflows/build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- 'v*'
99
pull_request:
1010

11+
permissions:
12+
contents: write
13+
1114
jobs:
1215
Ahk2Exe:
1316
name: Ahk2Exe
@@ -20,14 +23,15 @@ jobs:
2023
uses: ./.github/actions/ahk2exe
2124
with:
2225
in: AFB
26+
build_dir: build
2327

2428
- name: Release
2529
uses: softprops/action-gh-release@v1
2630
if: startsWith(github.ref, 'refs/tags/')
2731
with:
2832
files: |
29-
AFB_64-bit.exe
30-
AFB_32-bit.exe
33+
build/AFB_64-bit.exe
34+
build/AFB_32-bit.exe
3135
AFB.ahk
3236
env:
3337
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)