Skip to content

Commit a254fa2

Browse files
committed
Fix CI build: add CUDA paths after vcvarsall, improve workflow
- build.bat: add CUDA_PATH/include and CUDA_PATH/bin to INCLUDE/PATH after vcvarsall.bat resets the environment (fixes cuda_runtime.h not found) - workflow: add version detection step (from tag or version.h) - workflow: pass version to ISCC via /D flag for consistent naming - workflow: add DSD-FME verification step - ISS: accept MyAppVersion override from CLI, keep default for local builds
1 parent 1fd9763 commit a254fa2

3 files changed

Lines changed: 47 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@v4
2121

22+
# ── Determine version ───────────────────────────────────────────────
23+
- name: Determine version
24+
id: version
25+
shell: pwsh
26+
run: |
27+
if ($env:GITHUB_REF -match '^refs/tags/v(.+)$') {
28+
$ver = $Matches[1]
29+
} else {
30+
# Read from version.h
31+
$line = Get-Content include\version.h | Where-Object { $_ -match 'DMRCRACK_VERSION\s+"([^"]+)"' }
32+
$ver = $Matches[1]
33+
}
34+
Write-Host "Version: $ver"
35+
echo "VERSION=$ver" >> $env:GITHUB_OUTPUT
36+
2237
# ── CUDA ──────────────────────────────────────────────────────────────
2338
- name: Install CUDA Toolkit 12.6
2439
uses: Jimver/cuda-toolkit@v0.2.30
@@ -28,13 +43,13 @@ jobs:
2843
sub-packages: '["nvcc", "visual_studio_integration"]'
2944
use-github-env: true
3045

31-
# ── DSD-FME runtime (gitignored — download fresh each run) ────────────
46+
# ── DSD-FME runtime (gitignored — download fresh or from cache) ─────
3247
- name: Cache DSD-FME runtime
3348
id: cache-dsd
3449
uses: actions/cache@v4
3550
with:
36-
path: tools
37-
key: dsd-fme-portable-20251214
51+
path: tools/*.dll
52+
key: dsd-fme-portable-20251214-v2
3853

3954
- name: Download DSD-FME runtime
4055
if: steps.cache-dsd.outputs.cache-hit != 'true'
@@ -59,13 +74,29 @@ jobs:
5974
$dlls = (Get-ChildItem tools\*.dll | Measure-Object).Count
6075
Write-Host "Done. $dlls DLLs + dsd-fme.exe extracted."
6176
77+
- name: Verify DSD-FME files
78+
shell: pwsh
79+
run: |
80+
$exe = Test-Path "tools\dsd-fme.exe"
81+
$dlls = (Get-ChildItem tools\cyg*.dll -ErrorAction SilentlyContinue | Measure-Object).Count
82+
Write-Host "dsd-fme.exe present: $exe"
83+
Write-Host "Cygwin DLLs: $dlls"
84+
if (-not $exe -or $dlls -lt 10) {
85+
Write-Error "DSD-FME runtime is incomplete"
86+
exit 1
87+
}
88+
6289
# ── Build application ─────────────────────────────────────────────────
6390
- name: Build dmrcrack.exe
6491
shell: cmd
6592
run: |
6693
if not exist bin mkdir bin
6794
call build.bat
6895
if errorlevel 1 exit /b 1
96+
if not exist bin\dmrcrack.exe (
97+
echo ERROR: dmrcrack.exe was not produced
98+
exit /b 1
99+
)
69100
70101
# ── Installer ─────────────────────────────────────────────────────────
71102
- name: Install Inno Setup
@@ -74,7 +105,9 @@ jobs:
74105

75106
- name: Build installer
76107
shell: cmd
77-
run: '"%ProgramFiles(x86)%\Inno Setup 6\ISCC.exe" installer\FSP.DMRCrack.iss'
108+
run: |
109+
"%ProgramFiles(x86)%\Inno Setup 6\ISCC.exe" /DMyAppVersion="${{ steps.version.outputs.VERSION }}" installer\FSP.DMRCrack.iss
110+
if errorlevel 1 exit /b 1
78111
79112
# ── Artifacts ─────────────────────────────────────────────────────────
80113
- name: Upload installer artifact

build.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ if not defined VSINSTALL (
1616
call "%VSINSTALL%\VC\Auxiliary\Build\vcvarsall.bat" x64
1717
if errorlevel 1 exit /b %errorlevel%
1818

19+
REM Ensure CUDA paths are available after vcvarsall resets the environment
20+
if defined CUDA_PATH (
21+
set "PATH=%CUDA_PATH%\bin;%PATH%"
22+
set "INCLUDE=%CUDA_PATH%\include;%INCLUDE%"
23+
)
24+
1925
echo Building FSP.DMRCrack...
2026
nvcc -O3 -arch=sm_86 -cudart static -Iinclude -Xcompiler "/W4 /D_CRT_SECURE_NO_WARNINGS /DWIN32 /D_WINDOWS" src\main.c src\gui.c src\bruteforce.cu src\payload_io.c src\rc4.c src\lang_en.c src\updater.c -o bin\dmrcrack.exe -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ldwmapi -lshell32 -ladvapi32 -lwinhttp
2127
if %ERRORLEVEL% EQU 0 (

installer/FSP.DMRCrack.iss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
; To compile: open in Inno Setup Compiler and press Build (Ctrl+F9)
55

66
#define MyAppName "FSP.DMRCrack"
7-
#define MyAppVersion "0.1.0"
7+
; MyAppVersion can be overridden from CLI: ISCC /DMyAppVersion="0.2.0" ...
8+
#ifndef MyAppVersion
9+
#define MyAppVersion "0.1.2"
10+
#endif
811
#define MyAppPublisher "FSP-Labs"
912
#define MyAppURL "https://github.com/FSP-Labs"
1013
#define MyAppExeName "dmrcrack.exe"

0 commit comments

Comments
 (0)