-
Notifications
You must be signed in to change notification settings - Fork 3
176 lines (151 loc) · 6.57 KB
/
build.yml
File metadata and controls
176 lines (151 loc) · 6.57 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Build
on:
push:
branches: ['**']
pull_request:
branches: [master]
permissions:
contents: read
jobs:
build:
name: Compile dmrcrack.exe
runs-on: windows-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
# ── CUDA ─────────────────────────────────────────────────────────────────
# The cache stores the full CUDA Toolkit tree. On a cache hit we re-export
# the env vars that the Jimver action would normally set, so that build.bat
# can find nvcc and cuda_runtime.h after vcvarsall resets PATH.
- name: Cache CUDA Toolkit
id: cache-cuda
uses: actions/cache@v4
with:
path: C:\Program Files\NVIDIA GPU Computing Toolkit
key: cuda-12.6.0-windows
- name: Install CUDA Toolkit
if: steps.cache-cuda.outputs.cache-hit != 'true'
uses: Jimver/cuda-toolkit@v0.2.30
with:
cuda: '12.6.0'
method: 'network'
sub-packages: '["nvcc", "cudart"]'
use-github-env: true
- name: Set CUDA environment after cache restore
if: steps.cache-cuda.outputs.cache-hit == 'true'
shell: pwsh
run: |
$cuda = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6"
echo "CUDA_PATH=$cuda" >> $env:GITHUB_ENV
echo "$cuda\bin" >> $env:GITHUB_PATH
- name: Verify CUDA installation
run: nvcc --version
# ── DSD-FME runtime ───────────────────────────────────────────────────────
# tools/*.dll and tools/dsd-fme.exe are gitignored; they must be downloaded
# from the official portable release. We cache them in .github/dsd-fme-cache
# (separate from tools/) so that git-tracked scripts in tools/ are never
# overwritten by stale cache content.
- name: Cache DSD-FME runtime
id: cache-dsd
uses: actions/cache@v4
with:
path: .github/dsd-fme-cache
key: dsd-fme-portable-20251214-v2
- name: Download DSD-FME runtime
if: steps.cache-dsd.outputs.cache-hit != 'true'
shell: pwsh
run: |
$url = "https://github.com/lwvmobile/dsd-fme/releases/download/20251214/dsd-fme-x86-64-cygwin-portable.zip"
$tmp = "$env:RUNNER_TEMP\dsd-fme.zip"
New-Item -ItemType Directory -Force -Path .github/dsd-fme-cache | Out-Null
Write-Host "Downloading DSD-FME portable..."
Invoke-WebRequest -Uri $url -OutFile $tmp -UseBasicParsing
Write-Host "Extracting..."
Add-Type -AssemblyName System.IO.Compression.FileSystem
$z = [IO.Compression.ZipFile]::OpenRead($tmp)
foreach ($e in $z.Entries) {
if ($e.FullName -match '^dsd-fme-portable/dsd-fme/[^/]+$') {
if ($e.Name -match '\.dll$' -or $e.Name -eq 'dsd-fme.exe') {
[IO.Compression.ZipFileExtensions]::ExtractToFile($e, ".github/dsd-fme-cache/$($e.Name)", $true)
}
}
}
$z.Dispose()
Remove-Item $tmp
Copy-Item .github/dsd-fme-cache/* tools/
Write-Host "Done: $((Get-ChildItem tools/cyg*.dll | Measure-Object).Count) DLLs + dsd-fme.exe"
- name: Restore DSD-FME from cache
if: steps.cache-dsd.outputs.cache-hit == 'true'
shell: pwsh
run: Copy-Item .github/dsd-fme-cache/* tools/ -Force
- name: Verify DSD-FME files
shell: pwsh
run: |
$exe = Test-Path "tools/dsd-fme.exe"
$dlls = (Get-ChildItem tools/cyg*.dll -ErrorAction SilentlyContinue | Measure-Object).Count
Write-Host "dsd-fme.exe present: $exe | Cygwin DLLs: $dlls"
if (-not $exe -or $dlls -lt 10) { Write-Error "DSD-FME runtime incomplete"; exit 1 }
# ── Build ─────────────────────────────────────────────────────────────────
- name: Create bin directory
run: New-Item -ItemType Directory -Force -Path bin
- name: Build dmrcrack.exe
shell: cmd
run: |
call build.bat
if errorlevel 1 exit /b 1
if not exist bin\dmrcrack.exe (
echo ERROR: dmrcrack.exe not produced
exit /b 1
)
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: dmrcrack-${{ github.sha }}
path: bin\dmrcrack.exe
retention-days: 7
build-linux:
name: Compile dmrcrack (Linux CLI)
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
# ── CUDA ─────────────────────────────────────────────────────────────────
- name: Cache CUDA Toolkit
id: cache-cuda
uses: actions/cache@v4
with:
path: /usr/local/cuda-12.6
key: cuda-12.6.0-linux
- name: Install CUDA Toolkit
if: steps.cache-cuda.outputs.cache-hit != 'true'
uses: Jimver/cuda-toolkit@v0.2.30
with:
cuda: '12.6.0'
method: 'network'
sub-packages: '["nvcc", "cudart"]'
use-github-env: true
- name: Set CUDA environment after cache restore
if: steps.cache-cuda.outputs.cache-hit == 'true'
run: |
echo "CUDA_PATH=/usr/local/cuda-12.6" >> "$GITHUB_ENV"
echo "/usr/local/cuda-12.6/bin" >> "$GITHUB_PATH"
- name: Verify CUDA installation
run: nvcc --version
# ── Build ─────────────────────────────────────────────────────────────────
- name: Configure
run: cmake -S . -B build -DNO_GUI=ON -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --parallel
- name: Verify binary
run: |
test -f bin/dmrcrack
file bin/dmrcrack | grep -q "ELF 64-bit"
echo "Binary OK: $(file bin/dmrcrack)"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: dmrcrack-linux-${{ github.sha }}
path: bin/dmrcrack
retention-days: 7