3232 push :
3333 tags : ['v*']
3434 workflow_dispatch :
35+ inputs :
36+ version :
37+ description : " Version string for package names (e.g. 0.2.0). Blank = derive from ref."
38+ required : false
39+ default : " "
40+ coins :
41+ description : " JSON array of coins to build (e.g. [\" ltc\" ]). Blank = all five."
42+ required : false
43+ default : " "
3544
3645concurrency :
3746 group : release-${{ github.ref }}
@@ -50,14 +59,16 @@ jobs:
5059 strategy :
5160 fail-fast : false
5261 matrix :
53- coin : [ btc, ltc, dgb, dash, bch]
62+ coin : ${{ fromJSON(github.event.inputs.coins || '[" btc"," ltc"," dgb"," dash"," bch"]') }}
5463 steps :
5564 - uses : actions/checkout@v6
5665
5766 - name : Resolve version
5867 id : ver
5968 run : |
60- if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
69+ if [ -n "${{ github.event.inputs.version }}" ]; then
70+ echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
71+ elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
6172 echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
6273 else
6374 echo "version=0.0.0-${GITHUB_SHA:0:8}" >> "$GITHUB_OUTPUT"
@@ -186,7 +197,7 @@ jobs:
186197 strategy :
187198 fail-fast : false
188199 matrix :
189- coin : [ btc, ltc, dgb, dash, bch]
200+ coin : ${{ fromJSON(github.event.inputs.coins || '[" btc"," ltc"," dgb"," dash"," bch"]') }}
190201 arch : [arm64, x86_64]
191202 include :
192203 - arch : arm64
@@ -199,7 +210,9 @@ jobs:
199210 - name : Resolve version
200211 id : ver
201212 run : |
202- if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
213+ if [ -n "${{ github.event.inputs.version }}" ]; then
214+ echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
215+ elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
203216 echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
204217 else
205218 echo "version=0.0.0-${GITHUB_SHA:0:8}" >> "$GITHUB_OUTPUT"
@@ -299,14 +312,16 @@ jobs:
299312 strategy :
300313 fail-fast : false
301314 matrix :
302- coin : [ btc, ltc, dgb, dash, bch]
315+ coin : ${{ fromJSON(github.event.inputs.coins || '[" btc"," ltc"," dgb"," dash"," bch"]') }}
303316 steps :
304317 - uses : actions/checkout@v6
305318
306319 - name : Resolve version
307320 id : ver
308321 run : |
309- if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
322+ if [ -n "${{ github.event.inputs.version }}" ]; then
323+ echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
324+ elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
310325 echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
311326 else
312327 echo "version=0.0.0-${GITHUB_SHA:0:8}" >> "$GITHUB_OUTPUT"
@@ -374,6 +389,24 @@ jobs:
374389 name : pkg-macos-${{ matrix.coin }}
375390 path : c2pool-*-macos-universal.zip
376391
392+ - name : Build DMG installer
393+ if : steps.presence.outputs.exists == '1'
394+ run : |
395+ VERSION="${{ steps.ver.outputs.version }}"
396+ COIN="${{ matrix.coin }}"
397+ bash installer/macos/create-dmg.sh \
398+ --staged "c2pool-${COIN}-${VERSION}-macos-universal" \
399+ --name "c2pool-${COIN}" \
400+ --version "${VERSION}" \
401+ --arch universal
402+
403+ - name : Upload DMG installer
404+ if : steps.presence.outputs.exists == '1'
405+ uses : actions/upload-artifact@v7
406+ with :
407+ name : pkg-macos-dmg-${{ matrix.coin }}
408+ path : c2pool-*-macos-universal.dmg
409+
377410 # ════════════════════════════════════════════════════════════════════════════
378411 # Windows x86_64 (MSVC 2022, Conan)
379412 # ════════════════════════════════════════════════════════════════════════════
@@ -383,15 +416,17 @@ jobs:
383416 strategy :
384417 fail-fast : false
385418 matrix :
386- coin : [ btc, ltc, dgb, dash, bch]
419+ coin : ${{ fromJSON(github.event.inputs.coins || '[" btc"," ltc"," dgb"," dash"," bch"]') }}
387420 steps :
388421 - uses : actions/checkout@v6
389422
390423 - name : Resolve version
391424 id : ver
392425 shell : bash
393426 run : |
394- if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
427+ if [ -n "${{ github.event.inputs.version }}" ]; then
428+ echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
429+ elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
395430 echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
396431 else
397432 echo "version=0.0.0-${GITHUB_SHA:0:8}" >> "$GITHUB_OUTPUT"
@@ -490,6 +525,29 @@ jobs:
490525 name : pkg-windows-${{ matrix.coin }}
491526 path : c2pool-*-windows-x86_64.zip
492527
528+ - name : Build setup.exe installer (Inno Setup)
529+ if : steps.presence.outputs.exists == '1'
530+ shell : cmd
531+ run : |
532+ choco install innosetup -y --no-progress
533+ set "PKG=c2pool-${{ matrix.coin }}-${{ steps.ver.outputs.version }}-windows-x86_64"
534+ for /f "delims=" %%i in ('powershell -NoProfile -Command "(Get-ChildItem -Path 'C:\Program Files\Microsoft Visual Studio\2022' -Recurse -Filter vc_redist.x64.exe -ErrorAction SilentlyContinue | Select-Object -First 1).FullName"') do set "VCREDIST=%%i"
535+ "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" installer\windows\c2pool-setup.iss ^
536+ /DPACKAGE_DIR="%CD%\%PKG%" ^
537+ /DVCREDIST_PATH="%VCREDIST%" ^
538+ /DMyAppName=c2pool-${{ matrix.coin }} ^
539+ /DMyAppVersion=${{ steps.ver.outputs.version }} ^
540+ /DMyAppExeName=c2pool-${{ matrix.coin }}.exe ^
541+ /DOutputBase=%PKG%-setup
542+ copy "installer\windows\Output\%PKG%-setup.exe" .
543+
544+ - name : Upload setup.exe installer
545+ if : steps.presence.outputs.exists == '1'
546+ uses : actions/upload-artifact@v7
547+ with :
548+ name : pkg-windows-setup-${{ matrix.coin }}
549+ path : c2pool-*-windows-x86_64-setup.exe
550+
493551 # ════════════════════════════════════════════════════════════════════════════
494552 # Aggregate: single SHA256SUMS over every produced package; on tags,
495553 # attach everything to a DRAFT release (operator publishes manually).
0 commit comments