-
-
Notifications
You must be signed in to change notification settings - Fork 10
65 lines (54 loc) · 2.28 KB
/
build-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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}}