Build Release 🚀 #41
Workflow file for this run
This file contains 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: Build Release | |
run-name: Build Release 🚀 | |
on: [push] | |
jobs: | |
Build-Release: | |
runs-on: windows-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Install AutoHotkey v2 | |
shell: pwsh | |
run: | | |
$cwd = (Get-Item .).FullName; | |
Invoke-WebRequest "https://github.com/AutoHotkey/AutoHotkey/releases/download/v2.0.2/AutoHotkey_2.0.2.zip" -OutFile "$cwd\ahk-v2.zip"; | |
Expand-Archive -Path "$cwd\ahk-v2.zip" -DestinationPath "$cwd\_autohotkey\" -Force; | |
Remove-Item -Path "$cwd\ahk-v2.zip" -Force | |
Invoke-WebRequest "https://github.com/AutoHotkey/Ahk2Exe/releases/download/Ahk2Exe1.1.36.02e1/Ahk2Exe1.1.36.02e.zip" -OutFile "$cwd\Ahk2Exe.zip"; | |
Expand-Archive -Path "$cwd\Ahk2Exe.zip" -DestinationPath "$cwd\_autohotkey\Compiler" -Force; | |
Remove-Item -Path "$cwd\Ahk2Exe.zip" -Force | |
Write-Output ("$cwd\_autohotkey\;" + "$cwd\_autohotkey\Compiler") | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Run Ahk2Exe | |
shell: pwsh | |
run: | | |
$cwd = (Get-Item .).FullName; | |
$command = "$cwd\_autohotkey\Compiler\Ahk2Exe.exe /silent verbose " | |
$command += '/in "$cwd\AI-Tools.ahk" ' | |
$command += '/out "$cwd\AI-Tools.exe" ' | |
$command += '/icon "$cwd\icon.ico" ' | |
$command += '/base "$cwd\_autohotkey\AutoHotkey64.exe" ' | |
Invoke-Expression $command | |
- name: Clean up directories and Create .zip | |
shell: pwsh | |
run: | | |
$cwd = (Get-Item .).FullName; | |
Remove-Item "$cwd\_autohotkey" -Recurse | |
Remove-Item "$cwd\.github" -Recurse | |
Remove-Item "$cwd\.gitignore" | |
$compress = @{ | |
Path = "$cwd\*.*" | |
CompressionLevel = "Fastest" | |
DestinationPath = "$cwd\AI-Tools.zip" | |
} | |
Compress-Archive @compress | |
- name: List files in the repository | |
run: | | |
ls ${{ github.workspace }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: AI-Tools.zip | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |