Skip to content

Commit 3c6b1c8

Browse files
committed
chore: update GitHub Actions workflow to refine build and release process
chore: add vim.exe to .gitignore fix: simplify and improve error handling in build.bat script
1 parent 7c6fe14 commit 3c6b1c8

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

.github/workflows/build_test.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1-
on: [push, pull_request]
1+
on: [push]
22

3-
name: Build test
3+
name: Build
44

55
jobs:
66
build:
7-
name: Build test
7+
name: Build
8+
if: startsWith( github.ref, 'refs/tags/v' )
89
runs-on: windows-latest
910
permissions:
1011
contents: write
1112
steps:
1213
- name: Checkout code
1314
uses: actions/checkout@v4
14-
- name: Install AutoHotkey with Chocolatey
15-
uses: crazy-max/ghaction-chocolatey@v3
15+
- name: Build with latest AutoHotkey release
16+
uses: benmusson/ahk2exe-action@v1
1617
with:
17-
args: install autohotkey
18-
# fix for [Unable to copy error by command line · Issue #68 · AutoHotkey/Ahk2Exe](https://github.com/AutoHotkey/Ahk2Exe/issues/68)
19-
- name: build
18+
in: .\vim.ahk
19+
out: .\vim_ahk\vim_ahk.exe
20+
target: x64
21+
compression: upx
22+
ahk-tag: latest
23+
github-token: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Copy icons
2025
shell: cmd
21-
run: ./build.bat
26+
run: xcopy /i /y vim_ahk_icons vim_ahk\vim_ahk_icons
2227
- name: zip
23-
if: startsWith( github.ref, 'refs/tags/v' )
2428
shell: pwsh
2529
run:
2630
Compress-Archive -Path "vim_ahk" -DestinationPath vim_ahk-${{github.ref_name}}.zip
2731
- name: Create Release
28-
if: startsWith( github.ref, 'refs/tags/v' )
29-
id: create_release
3032
uses: softprops/action-gh-release@v2
3133
with:
3234
files: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
testLogs/
22
vim_ahk/
3+
vim.exe
34
.DS_Store

build.bat

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,18 @@ REM Takes a simple optional command parameter, /t, which starts testing before b
44
SET Param1=%1
55

66
if "%Param1%"=="/t" (
7-
start /w "%AHKPath%\v2\Autohotkey.exe" vim.ahk -quiet
8-
)
9-
REM Return code from above (0 if tests all pass) is stored in %errorlevel%
10-
if errorlevel 1 (
11-
echo .
12-
echo .
13-
echo Tests failed. Exes not built. Log contents:
14-
echo .
15-
echo .
16-
type testLogs\*
17-
echo .
18-
echo .
19-
exit /b %errorlevel%
7+
start /w "%AHKPath%\v2\Autohotkey.exe" tests/run_vimahk_tests.ahk -quiet
8+
REM Return code from above (0 if tests all pass) is stored in %errorlevel%
9+
if %errorlevel% neq 0 (
10+
echo Tests failed.
11+
exit /b %errorlevel%
12+
)
2013
)
2114
if exist vim_ahk rmdir /s /q vim_ahk
2215
mkdir vim_ahk
23-
"%AHKPath%\Compiler\Ahk2Exe.exe" /in vim.ahk /out vim_ahk\vim_ahk.exe /compress 0 /base "%AHKPath%\v2\AutoHotkey.exe"
16+
"%AHKPath%\Compiler\Ahk2Exe.exe" /in vim.ahk /out vim_ahk\vim_ahk.exe /compress 0 /silent /base "%AHKPath%\v2\AutoHotkey.exe"
17+
if %errorlevel% neq 0 (
18+
echo Build failed.
19+
exit /b %errorlevel%
20+
)
2421
xcopy /i /y vim_ahk_icons vim_ahk\vim_ahk_icons

0 commit comments

Comments
 (0)