@@ -14,39 +14,47 @@ inputs:
1414 description : The icon of the executable file is specified
1515 required : false
1616 default : ' '
17+ base :
18+ description : The name of the base file to be used for Ahk2Exe
19+ required : false
20+ default : ' '
1721
1822runs :
1923 using : composite
2024 steps :
21- - name : Install Scoop
22- shell : powershell
23- run : |
24- iwr -useb get.scoop.sh | iex
25- scoop bucket add extras
26-
27- - name : Add to environment variables
28- shell : powershell
29- run : Write-Output ('Path=' + $Env:SystemDrive + '\Windows\System32' + ';' + $Env:UserProfile + '\scoop\shims') >> $Env:GITHUB_ENV
30-
3125 - name : Install AutoHotkey
32- shell : powershell
33- run : scoop install autohotkey
34-
35- - name : Ahk2Exe
36- shell : powershell
26+ shell : pwsh
3727 run : |
38- if (('${{inputs.in}}' -ne '') -and ('${{inputs.out}}' -ne '') -and ('${{inputs.icon}}' -ne '')) {
39- ahk2exe /in '${{inputs.in}}' /out '${{inputs.out}}' /icon '${{inputs.icon}}'
40- } elseif (('${{inputs.in}}' -ne '') -and ('${{inputs.out}}' -ne '')) {
41- ahk2exe /in '${{inputs.in}}' /out '${{inputs.out}}'
42- } elseif (('${{inputs.in}}' -ne '') -and ('${{inputs.icon}}' -ne '')) {
43- ahk2exe /in '${{inputs.in}}' /icon '${{inputs.icon}}'
44- } elseif ('${{inputs.in}}' -ne '') {
45- ahk2exe /in '${{inputs.in}}'
46- } else {
47- throw 'There are no required parameters'
28+ $cwd = (Get-Item .).FullName;
29+ Invoke-WebRequest "https://www.autohotkey.com/download/ahk.zip" -OutFile "$cwd\autohotkey.zip";
30+ Expand-Archive -Path "$cwd\autohotkey.zip" -DestinationPath "$cwd\_autohotkey\" -Force;
31+ Remove-Item -Path "$cwd\autohotkey.zip" -Force
32+ Write-Output ("$cwd\_autohotkey\;" + "$cwd\_autohotkey\Compiler") | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
33+ if('${{inputs.base}}' -ne ''){
34+ Write-Output ("BaseFile=$cwd\_autohotkey\Compiler\${{inputs.base}}.bin") | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
35+ }else{
36+ Copy-Item -Path "$cwd\_autohotkey\Compiler\Unicode 32-bit.bin" -Destination "$cwd\_autohotkey\Compiler\AutoHotkeySC.bin"
4837 }
4938
39+ - name : Run Ahk2Exe
40+ shell : pwsh
41+ run : |
42+ $command = 'ahk2exe.exe /silent verbose '
43+ if('${{inputs.in}}' -ne ''){
44+ $command += '/in "${{inputs.in}}" '
45+ }
46+ if('${{inputs.out}}' -ne ''){
47+ $command += '/out "${{inputs.out}}" '
48+ }
49+ if('${{inputs.icon}}' -ne ''){
50+ $command += '/icon "${{inputs.icon}}" '
51+ }
52+ if('${{inputs.base}}' -ne ''){
53+ $command += '/base "$Env:BaseFile" '
54+ }
55+ $command += "| Write-Output"
56+ Invoke-Expression $command
57+
5058branding :
5159 color : green
5260 icon : terminal
0 commit comments