Skip to content

Commit

Permalink
fix: Zip produced is now the for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosroman committed Nov 10, 2020
1 parent 2670e26 commit d994ce0
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 10 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}
2 changes: 1 addition & 1 deletion bin/jmxterm.bat
Original file line number Diff line number Diff line change
@@ -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" %*
24 changes: 23 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,17 @@ tasks.register<Zip>("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<Tar>("jlinkDistTar") {
Expand Down Expand Up @@ -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",
Expand All @@ -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")
}
16 changes: 16 additions & 0 deletions pkg/windows/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<Feature Id="ProductFeature" Title="NRJMX" Level="1">
<ComponentRef Id="CMP_V1_NRJMX_DIRECTORY"/>
<ComponentGroupRef Id="CMP_GRP_NRJMX_BAT"/>
<ComponentGroupRef Id="CMP_GRP_JMXTERM_BAT"/>
<ComponentGroupRef Id="JlinkFiles"/>
</Feature>
</Product>
Expand Down Expand Up @@ -55,4 +56,19 @@
</Component>
</ComponentGroup>
</Fragment>

<Fragment>
<ComponentGroup Id="CMP_GRP_JMXTERM_BAT" Directory="NrjmxDirectory">
<Component Id="CMP_JMXTERM_BAT" Guid="fb3b675c-4905-45bd-a37f-8a9fb9dc2bcf" Win64="yes">
<File Id="FILE_JMXTERM_BAT"
Source="$(var.BinPath)jmxterm.bat"
KeyPath="yes"/>
</Component>
<Component Id="CMP_JMXTERM_JAR" Guid="fb3b675c-4905-45bd-a37f-8a9fb9dc2bdf" Win64="yes">
<File Id="FILE_JMXTERM_JAR"
Source="$(var.JmxtermJarPath)jmxterm-uber.jar"
KeyPath="yes"/>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
4 changes: 2 additions & 2 deletions pkg/windows/nrjmx-installer.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>..\..\target\msi\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;ProjectRootPath=..\..\..\;BuildDir=..\..\build\image;BinPath=..\..\bin\</DefineConstants>
<DefineConstants>Debug;ProjectRootPath=..\..\..\;BuildDir=..\..\build\image;BinPath=..\..\bin\;JmxtermJarPath=..\..\build\jmxterm\lib\</DefineConstants>
<SuppressAllWarnings>True</SuppressAllWarnings>
<Pedantic>False</Pedantic>
<CompilerAdditionalOptions>-arch x64</CompilerAdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>..\..\target\msi\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;ProjectRootPath=..\..\..\;BuildDir=..\..\build\image;BinPath=..\..\bin\</DefineConstants>
<DefineConstants>Debug;ProjectRootPath=..\..\..\;BuildDir=..\..\build\image;BinPath=..\..\bin\;JmxtermJarPath=..\..\build\jmxterm\lib\</DefineConstants>
<CompilerAdditionalOptions>-arch x64</CompilerAdditionalOptions>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions script/upload_zip_release.sh
Original file line number Diff line number Diff line change
@@ -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}"

0 comments on commit d994ce0

Please sign in to comment.