Skip to content

Commit

Permalink
chore: update GitHub Actions workflow to refine build and release pro…
Browse files Browse the repository at this point in the history
…cess

chore: add vim.exe to .gitignore
fix: simplify and improve error handling in build.bat script
  • Loading branch information
rcmdnk committed Dec 10, 2024
1 parent 7c6fe14 commit 3c6b1c8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
on: [push, pull_request]
on: [push]

name: Build test
name: Build

jobs:
build:
name: Build test
name: Build
if: startsWith( github.ref, 'refs/tags/v' )
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install AutoHotkey with Chocolatey
uses: crazy-max/ghaction-chocolatey@v3
- name: Build with latest AutoHotkey release
uses: benmusson/ahk2exe-action@v1
with:
args: install autohotkey
# fix for [Unable to copy error by command line · Issue #68 · AutoHotkey/Ahk2Exe](https://github.com/AutoHotkey/Ahk2Exe/issues/68)
- name: build
in: .\vim.ahk
out: .\vim_ahk\vim_ahk.exe
target: x64
compression: upx
ahk-tag: latest
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Copy icons
shell: cmd
run: ./build.bat
run: xcopy /i /y vim_ahk_icons vim_ahk\vim_ahk_icons
- name: zip
if: startsWith( github.ref, 'refs/tags/v' )
shell: pwsh
run:
Compress-Archive -Path "vim_ahk" -DestinationPath vim_ahk-${{github.ref_name}}.zip
- name: Create Release
if: startsWith( github.ref, 'refs/tags/v' )
id: create_release
uses: softprops/action-gh-release@v2
with:
files: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
testLogs/
vim_ahk/
vim.exe
.DS_Store
25 changes: 11 additions & 14 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@ REM Takes a simple optional command parameter, /t, which starts testing before b
SET Param1=%1

if "%Param1%"=="/t" (
start /w "%AHKPath%\v2\Autohotkey.exe" vim.ahk -quiet
)
REM Return code from above (0 if tests all pass) is stored in %errorlevel%
if errorlevel 1 (
echo .
echo .
echo Tests failed. Exes not built. Log contents:
echo .
echo .
type testLogs\*
echo .
echo .
exit /b %errorlevel%
start /w "%AHKPath%\v2\Autohotkey.exe" tests/run_vimahk_tests.ahk -quiet
REM Return code from above (0 if tests all pass) is stored in %errorlevel%
if %errorlevel% neq 0 (
echo Tests failed.
exit /b %errorlevel%
)
)
if exist vim_ahk rmdir /s /q vim_ahk
mkdir vim_ahk
"%AHKPath%\Compiler\Ahk2Exe.exe" /in vim.ahk /out vim_ahk\vim_ahk.exe /compress 0 /base "%AHKPath%\v2\AutoHotkey.exe"
"%AHKPath%\Compiler\Ahk2Exe.exe" /in vim.ahk /out vim_ahk\vim_ahk.exe /compress 0 /silent /base "%AHKPath%\v2\AutoHotkey.exe"
if %errorlevel% neq 0 (
echo Build failed.
exit /b %errorlevel%
)
xcopy /i /y vim_ahk_icons vim_ahk\vim_ahk_icons

0 comments on commit 3c6b1c8

Please sign in to comment.