Skip to content

Commit

Permalink
(chore) create windows binary
Browse files Browse the repository at this point in the history
  • Loading branch information
kounkou committed Nov 7, 2024
1 parent 82ac62e commit 0d97fb4
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,31 @@ on:
pull_request:

jobs:
build-windows:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Qt5 on Windows
run: |
choco install qt5 -y
set PATH=%PATH%;C:\tools\qt5\bin # Ensure qmake is in the PATH
- name: Set architecture for build
run: echo "Building for Windows x64 architecture"

- name: Build application
run: |
.\build.bat windows-latest-x64-binary # Ensure your build.bat script exists and is configured for Windows
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: Hedgehog-windows-latest-x64-binary
path: Hedgehog-windows-latest-x64-binary

build-linux:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -78,6 +103,12 @@ jobs:
with:
name: Hedgehog-macos-latest-arm64-binary
path: ./

- name: Download Windows x64 binary
uses: actions/download-artifact@v3
with:
name: Hedgehog-windows-latest-x64-binary
path: ./

- name: Create Draft Release
id: create_release
Expand Down
28 changes: 28 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@echo off

REM Function to replace destination binary path in Makefile (Windows equivalent)
setlocal
set "file=Makefile"
set "string_to_replace=Hedgehog.app\\Contents\\MacOS\\"
set "replacement_string="

REM Use PowerShell to replace the string
powershell -Command "(Get-Content %file%) -replace '%string_to_replace%', '%replacement_string%' | Set-Content %file%"
echo Replaced "%string_to_replace%" with "%replacement_string%" in "%file%".

REM Clean previous builds
if exist build rmdir /S /Q build
mkdir build

REM Run qmake and make
qmake
nmake

REM Copy the final binary
if "%~1"=="" (
copy "build\Hedgehog.exe" "Hedgehog.exe"
) else (
copy "build\Hedgehog.exe" "Hedgehog-%~1.exe"
)

endlocal

0 comments on commit 0d97fb4

Please sign in to comment.