diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index e6e0d579..3a4e9ef1 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -73,7 +73,7 @@ jobs: - name: Sign packages run: ./script/sign.sh - name: Upload release asset to GitHub Release - run: script/upload_to_linux_release.sh ./build/distributions/nrjmx ${{ env.TAG }} + run: script/upload_linux_release.sh ./build/distributions/nrjmx ${{ env.TAG }} package-windows: name: Run Windows package task @@ -100,7 +100,7 @@ jobs: java-version: '11' java-package: jdk - name: Build jlink code - run: ./gradlew jlink --info --stacktrace + run: ./gradlew package-windows --info --stacktrace - name: Get PFX certificate from GH secrets run: '[IO.File]::WriteAllBytes("wincert.pfx", [Convert]::FromBase64String($env:PFX_CERTIFICATE_BASE64))' - name: Install cert @@ -109,4 +109,7 @@ jobs: run: ./win_build.ps1 -arch ${{ matrix.arch }} -version ${{ env.TAG }} - name: Upload release asset to GitHub Release shell: bash - run: script/upload_to_release.sh ./target/msi/Release/nrjmx-${{ matrix.arch }} ${{ env.TAG }} + run: script/upload_windows_release.sh ./target/msi/Release/nrjmx-${{ matrix.arch }} ${{ env.TAG }} + - name: Upload release asset to GitHub Release + shell: bash + run: script/upload_zip_release.sh ./build/distributions/nrjmx ${{ env.TAG }} diff --git a/bin/jmxterm.bat b/bin/jmxterm.bat index 32cc56a7..f5ad6a5d 100644 --- a/bin/jmxterm.bat +++ b/bin/jmxterm.bat @@ -1,2 +1,2 @@ @echo off -java -jar "C:\Program Files\New Relic\nrjmx\jmxterm.jar" %* +"%~dp0/bin/java" -jar "C:\Program Files\New Relic\nrjmx\jmxterm-uber.jar" %* diff --git a/build.gradle.kts b/build.gradle.kts index a7d28f36..bde473f6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -113,12 +113,17 @@ tasks.register("jlinkDistZip") { from("${buildDir}/jmxterm/lib") { include("jmxterm-uber.jar") - into("lib") } from("${buildDir}/jmxterm/bin") { into("bin") fileMode = 0x1ED } + from("bin/nrjmx.bat") { + fileMode = 0x1ED + } + from("bin/jmxterm.bat") { + fileMode = 0x1ED + } } tasks.register("jlinkDistTar") { @@ -242,6 +247,14 @@ tasks.distTar { tasks.register("package") { group = "Distribution" description = "Builds all packages" + dependsOn( + "package-linux", + "package-windows") +} + +tasks.register("package-linux") { + group = "Distribution" + description = "Builds all packages for Linux" dependsOn( "noarchJar", "distTar", @@ -251,3 +264,12 @@ tasks.register("package") { "jlinkDistZip", "jlinkDistTar") } + +tasks.register("package-windows") { + group = "Distribution" + description = "Builds all packages for Windows" + dependsOn( + "noarchJar", + "distZip", + "jlinkDistZip") +} \ No newline at end of file diff --git a/pkg/windows/Product.wxs b/pkg/windows/Product.wxs index 6954dcd3..6f58ed95 100755 --- a/pkg/windows/Product.wxs +++ b/pkg/windows/Product.wxs @@ -24,6 +24,7 @@ + @@ -55,4 +56,19 @@ + + + + + + + + + + + diff --git a/pkg/windows/nrjmx-installer.wixproj b/pkg/windows/nrjmx-installer.wixproj index 795fb576..4578a4b8 100755 --- a/pkg/windows/nrjmx-installer.wixproj +++ b/pkg/windows/nrjmx-installer.wixproj @@ -18,7 +18,7 @@ ..\..\target\msi\$(Configuration)\ obj\$(Configuration)\ - Debug;ProjectRootPath=..\..\..\;BuildDir=..\..\build\image;BinPath=..\..\bin\ + Debug;ProjectRootPath=..\..\..\;BuildDir=..\..\build\image;BinPath=..\..\bin\;JmxtermJarPath=..\..\build\jmxterm\lib\ True False -arch x64 @@ -26,7 +26,7 @@ ..\..\target\msi\$(Configuration)\ obj\$(Configuration)\ - Debug;ProjectRootPath=..\..\..\;BuildDir=..\..\build\image;BinPath=..\..\bin\ + Debug;ProjectRootPath=..\..\..\;BuildDir=..\..\build\image;BinPath=..\..\bin\;JmxtermJarPath=..\..\build\jmxterm\lib\ -arch x64 diff --git a/script/upload_to_linux_release.sh b/script/upload_linux_release.sh similarity index 85% rename from script/upload_to_linux_release.sh rename to script/upload_linux_release.sh index af6586c9..82f89115 100755 --- a/script/upload_to_linux_release.sh +++ b/script/upload_linux_release.sh @@ -22,9 +22,6 @@ hub release edit -a "${INTEGRATION_PATH}-${SEMVER}-1.x86_64.rpm" -m "${TAG}" "${ echo "===> Uploading ${INTEGRATION_PATH}-${SEMVER}-noarch.ja to ${TAG}" hub release edit -a "${INTEGRATION_PATH}-${SEMVER}-noarch.jar" -m "${TAG}" "${TAG}" -echo "===> Uploading ${INTEGRATION_PATH}-${SEMVER}-jlink.zip to ${TAG}" -hub release edit -a "${INTEGRATION_PATH}-${SEMVER}-jlink.zip" -m "${TAG}" "${TAG}" - echo "===> Uploading ${INTEGRATION_PATH}-${SEMVER}.tar.gz to ${TAG}" hub release edit -a "${INTEGRATION_PATH}-${SEMVER}.tar.gz" -m "${TAG}" "${TAG}" diff --git a/script/upload_to_release.sh b/script/upload_windows_release.sh similarity index 100% rename from script/upload_to_release.sh rename to script/upload_windows_release.sh diff --git a/script/upload_zip_release.sh b/script/upload_zip_release.sh new file mode 100755 index 00000000..5accef6c --- /dev/null +++ b/script/upload_zip_release.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env sh +set -e + +# +# +# +# Upload binary to release page +# +# +# + +INTEGRATION_PATH=$1 +TAG=$2 +SEMVER=`echo "${TAG}" | cut -c 2-` + +echo "===> Uploading ${INTEGRATION_PATH}-${SEMVER}-jlink.zip to ${TAG}" +hub release edit -a "${INTEGRATION_PATH}-${SEMVER}-jlink.zip" -m "${TAG}" "${TAG}"