From 3b5f3d64d2dcceba43816c724c06cb095bccb87e Mon Sep 17 00:00:00 2001 From: atsamd21 Date: Sat, 6 Dec 2025 21:04:34 +0100 Subject: [PATCH] Build daemon.jar using GitHub actions (#2054) --- .github/workflows/build.yml | 44 ++++++++++++++++++++++++++++++++++++- Makefile | 3 +++ build.gradle | 2 ++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f51adc8cb..be7d1c1973 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,6 +101,13 @@ jobs: run: ./gradlew packageInstallers working-directory: . + - name: Build Daemon JAR + if: > + (runner.os == 'Linux' && (matrix.arch == 'x86_64' || matrix.arch == 'aarch64')) + || (runner.os == 'Windows') + run: ./gradlew :daemon:shadowJar -x test -x checkstyleMain -x checkstyleTest --stacktrace + working-directory: . + # get version from jar - name: Set Version Unix if: runner.os != 'Windows' @@ -147,7 +154,32 @@ jobs: Copy-Item -Path desktop\build\temp-*/binaries\desktop-*.jar.SHA-256 -Destination ${{ github.workspace }}/release-windows Move-Item -Path desktop\build\temp-*/binaries\desktop-*.jar.SHA-256 -Destination ${{ github.workspace }}/haveno-v${{ env.VERSION }}-windows-SNAPSHOT-all.jar.SHA-256 shell: powershell - + - name: Move Daemon JAR on Linux + if: runner.os == 'Linux' + run: | + mkdir -p ${{ github.workspace }}/release-daemon-linux-${{ matrix.arch }} + mv daemon/build/libs/daemon-all.jar ${{ github.workspace }}/release-daemon-linux-${{ matrix.arch }}/daemon-linux-${{ matrix.arch }}.jar + sha256sum ${{ github.workspace }}/release-daemon-linux-${{ matrix.arch }}/daemon-linux-${{ matrix.arch }}.jar > ${{ github.workspace }}/release-daemon-linux-${{ matrix.arch }}/daemon-linux-${{ matrix.arch }}.jar.SHA-256 + shell: bash + - name: Move Daemon JAR on Windows + if: runner.os == 'Windows' + run: | + mkdir ${{ github.workspace }}\release-daemon-windows + Move-Item daemon\build\libs\daemon-all.jar ${{ github.workspace }}\release-daemon-windows\daemon-windows.jar + Get-FileHash ${{ github.workspace }}\release-daemon-windows\daemon-windows.jar -Algorithm SHA256 | ForEach-Object { $_.Hash } > ${{ github.workspace }}\release-daemon-windows\daemon-windows.jar.SHA-256 + shell: powershell + - uses: actions/upload-artifact@v4 + name: "Linux daemon artifacts" + if: runner.os == 'Linux' + with: + name: daemon-linux-${{ matrix.arch }} + path: ${{ github.workspace }}/release-daemon-linux-${{ matrix.arch }} + - uses: actions/upload-artifact@v4 + name: "Windows daemon artifacts" + if: runner.os == 'Windows' + with: + name: daemon-windows + path: ${{ github.workspace }}/release-daemon-windows # Windows artifacts - uses: actions/upload-artifact@v4 name: "Windows artifacts" @@ -224,6 +256,16 @@ jobs: ${{ github.workspace }}/release-windows/haveno-v${{ env.VERSION }}-windows-x86_64-installer.exe ${{ github.workspace }}/haveno-v${{ env.VERSION }}-windows-SNAPSHOT-all.jar.SHA-256 + # Daemon JARs + ${{ github.workspace }}/release-daemon-linux-x86_64/daemon-linux-x86_64.jar + ${{ github.workspace }}/release-daemon-linux-x86_64/daemon-linux-x86_64.jar.SHA-256 + + ${{ github.workspace }}/release-daemon-linux-aarch64/daemon-linux-aarch64.jar + ${{ github.workspace }}/release-daemon-linux-aarch64/daemon-linux-aarch64.jar.SHA-256 + + ${{ github.workspace }}/release-daemon-windows/daemon-windows.jar + ${{ github.workspace }}/release-daemon-windows/daemon-windows.jar.SHA-256 + # https://git-scm.com/docs/git-tag - git-tag Docu # # git tag - lists all local tags diff --git a/Makefile b/Makefile index 6ff271ffed..297d92c0cc 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,9 @@ haveno: update-dependencies: ./gradlew --refresh-dependencies && ./gradlew --write-verification-metadata sha256 +daemon: localnet + ./gradlew :daemon:shadowJar -x test -x checkstyleMain -x checkstyleTest + # build haveno without tests skip-tests: localnet ./gradlew build -x test -x checkstyleMain -x checkstyleTest diff --git a/build.gradle b/build.gradle index e7c027d57f..2ee80eed9c 100644 --- a/build.gradle +++ b/build.gradle @@ -791,6 +791,8 @@ configure(project(':statsnode')) { configure(project(':daemon')) { mainClassName = 'haveno.daemon.app.HavenoDaemonMain' + apply plugin: 'com.github.johnrengelman.shadow' + dependencies { implementation project(':proto') implementation project(':common')