From c693775210cd7549b788140c7b89a07ce4c94833 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 20 Nov 2024 22:25:36 +0100 Subject: [PATCH 1/7] use a common jpackage argument file [ci skip] --- build_linux.sh | 19 ++----------------- build_mac.sh | 19 ++----------------- build_win.ps1 | 23 ++++------------------- dist/jpackage.args | 15 +++++++++++++++ 4 files changed, 23 insertions(+), 53 deletions(-) create mode 100644 dist/jpackage.args diff --git a/build_linux.sh b/build_linux.sh index da5dc5f..1eaac16 100644 --- a/build_linux.sh +++ b/build_linux.sh @@ -61,23 +61,8 @@ fi echo "Creating app binary with jpackage..." "$JAVA_HOME/bin/jpackage" \ - --verbose \ - --type app-image \ - --runtime-image target/runtime \ - --input target/libs \ - --module-path target/mods \ - --module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli \ - --dest target \ - --name cryptomator-cli \ - --vendor "Skymatic GmbH" \ - --copyright "(C) 2016 - 2024 Skymatic GmbH" \ - --app-version "0.0.1.0" \ - --java-options "-Dorg.cryptomator.cli.version=0.0.1-local" \ - --java-options "--enable-preview" \ - --java-options "--enable-native-access=${NATIVE_ACCESS_PACKAGE}" \ - --java-options "-Xss5m" \ - --java-options "-Xmx256m" \ - --java-options "-Dfile.encoding=utf-8" \ + '@./dist/jpackage.args' \ + --java-options "--enable-native-access=${NATIVE_ACCESS_PACKAGE}" if [ $? -ne 0 ] || [ ! -d ./target/cryptomator-cli ]; then echo "Binary creation with jpackage failed." diff --git a/build_mac.sh b/build_mac.sh index 7d8350b..ac3531c 100644 --- a/build_mac.sh +++ b/build_mac.sh @@ -46,23 +46,8 @@ fi echo "Creating app binary with jpackage..." "$JAVA_HOME/bin/jpackage" \ - --verbose \ - --type app-image \ - --runtime-image target/runtime \ - --input target/libs \ - --module-path target/mods \ - --module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli \ - --dest target \ - --name cryptomator-cli \ - --vendor "Skymatic GmbH" \ - --copyright "(C) 2016 - 2024 Skymatic GmbH" \ - --app-version "99.9.9" \ - --java-options "-Dorg.cryptomator.cli.version=0.0.1-local" \ - --java-options "--enable-preview" \ - --java-options "--enable-native-access=org.cryptomator.jfuse.mac" \ - --java-options "-Xss5m" \ - --java-options "-Xmx256m" \ - --java-options "-Dfile.encoding=utf-8" \ + '@./dist/jpackage.args' \ + --java-options "--enable-native-access=org.cryptomator.jfuse.mac" if [ $? -ne 0 ] || [ ! -d ./target/cryptomator-cli.app ]; then echo "Binary creation with jpackage failed." diff --git a/build_win.ps1 b/build_win.ps1 index 3cafd14..be23ea9 100644 --- a/build_win.ps1 +++ b/build_win.ps1 @@ -14,7 +14,7 @@ if(-not $env:JAVA_HOME) { # Check Java version $minJavaVersion=$(mvn help:evaluate "-Dexpression=jdk.version" -q -DforceStdout) $javaVersion = $(& "$env:JAVA_HOME\bin\java" --version) -split ' ' | Select-Object -Index 1 -if( ($javaVersion -split '.' | Select-Object -First 1) -ne "22") { +if( ($javaVersion.Split('.') | Select-Object -First 1) -ne "22") { throw "Java version $javaVersion is too old. Minimum required version is $minJavaVersion" } @@ -43,24 +43,9 @@ if ( ($LASTEXITCODE -ne 0) -or (-not (Test-Path ./target/runtime))) { # app-version is hard coded, since the script is only for local test builds Write-Host "Creating app binary with jpackage..." & $env:JAVA_HOME/bin/jpackage ` - --verbose ` - --type app-image ` - --runtime-image target/runtime ` - --input target/libs ` - --module-path target/mods ` - --module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli ` - --dest target ` - --name cryptomator-cli ` - --vendor "Skymatic GmbH" ` - --copyright "(C) 2016 - 2024 Skymatic GmbH" ` - --app-version "0.0.1.0" ` - --java-options "-Dorg.cryptomator.cli.version=0.0.1-local" ` - --java-options "--enable-preview" ` - --java-options "--enable-native-access=org.cryptomator.jfuse.win" ` - --java-options "-Xss5m" ` - --java-options "-Xmx256m" ` - --java-options '-Dfile.encoding="utf-8"' ` - --win-console +`@./dist/jpackage.args ` +--java-options "--enable-native-access=org.cryptomator.jfuse.win" ` +--win-console if ( ($LASTEXITCODE -ne 0) -or (-not (Test-Path ./target/cryptomator-cli))) { throw "Binary creation with jpackage failed with exit code $LASTEXITCODE." diff --git a/dist/jpackage.args b/dist/jpackage.args new file mode 100644 index 0000000..c8c5c7f --- /dev/null +++ b/dist/jpackage.args @@ -0,0 +1,15 @@ +--verbose +--type app-image +--runtime-image target/runtime +--input target/libs +--module-path target/mods +--module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli +--dest target +--name cryptomator-cli +--vendor "Skymatic GmbH" +--copyright "(C) 2016 - 2024 Skymatic GmbH" +--app-version "99.9.9" +--java-options "-Dorg.cryptomator.cli.version=0.1.0-local" +--java-options "-Xss5m" +--java-options "-Xmx256m" +--java-options "-Dfile.encoding=\"utf-8\"" \ No newline at end of file From b417ff50de213ab19c0a4e9e54fc6e8929a22a02 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 20 Nov 2024 22:38:12 +0100 Subject: [PATCH 2/7] also use for jlink an argument file [ci skip] --- build_linux.sh | 11 ++--------- build_mac.sh | 11 ++--------- build_win.ps1 | 19 ++++++------------- dist/jlink.args | 8 ++++++++ 4 files changed, 18 insertions(+), 31 deletions(-) create mode 100644 dist/jlink.args diff --git a/build_linux.sh b/build_linux.sh index 1eaac16..41b4409 100644 --- a/build_linux.sh +++ b/build_linux.sh @@ -30,15 +30,8 @@ mv ./target/cryptomator-cli-*.jar ./target/mods echo "Creating JRE with jlink..." "$JAVA_HOME/bin/jlink" \ - --verbose \ - --output target/runtime \ - --module-path "${JAVA_HOME}/jmods" \ - --add-modules java.base,java.compiler,java.naming,java.xml \ - --strip-native-commands \ - --no-header-files \ - --no-man-pages \ - --strip-debug \ - --compress zip-0 + '@./dist/jlink.args' \ + --module-path "${JAVA_HOME}/jmods" if [ $? -ne 0 ] || [ ! -d ./target/runtime ]; then echo "JRE creation with jlink failed." diff --git a/build_mac.sh b/build_mac.sh index ac3531c..8c7b6b9 100644 --- a/build_mac.sh +++ b/build_mac.sh @@ -29,15 +29,8 @@ mv ./target/cryptomator-cli-*.jar ./target/mods echo "Creating JRE with jlink..." "$JAVA_HOME/bin/jlink" \ - --verbose \ - --output target/runtime \ - --module-path "${JAVA_HOME}/jmods" \ - --add-modules java.base,java.compiler,java.naming,java.xml \ - --strip-native-commands \ - --no-header-files \ - --no-man-pages \ - --strip-debug \ - --compress zip-0 + '@./dist/jlink.args' \ + --module-path "${JAVA_HOME}/jmods" if [ $? -ne 0 ] || [ ! -d ./target/runtime ]; then echo "JRE creation with jlink failed." diff --git a/build_win.ps1 b/build_win.ps1 index be23ea9..c4bc6cf 100644 --- a/build_win.ps1 +++ b/build_win.ps1 @@ -25,27 +25,20 @@ Move-Item ./target/cryptomator-cli-*.jar ./target/mods -ErrorAction Stop Write-Host "Creating JRE with jlink..." & $env:JAVA_HOME/bin/jlink ` ---verbose ` ---output target/runtime ` ---module-path "${env:JAVA_HOME}/jmods" ` ---add-modules java.base,java.compiler,java.naming,java.xml ` ---strip-native-commands ` ---no-header-files ` ---no-man-pages ` ---strip-debug ` ---compress zip-0 + `@./dist/jlink.args ` + --module-path "${env:JAVA_HOME}/jmods" if ( ($LASTEXITCODE -ne 0) -or (-not (Test-Path ./target/runtime))) { - throw "JRE creation with jLink failed with exit code $LASTEXITCODE." + throw "JRE creation with jLink failed with exit code $LASTEXITCODE." } # jpackage # app-version is hard coded, since the script is only for local test builds Write-Host "Creating app binary with jpackage..." & $env:JAVA_HOME/bin/jpackage ` -`@./dist/jpackage.args ` ---java-options "--enable-native-access=org.cryptomator.jfuse.win" ` ---win-console + `@./dist/jpackage.args ` + --java-options "--enable-native-access=org.cryptomator.jfuse.win" ` + --win-console if ( ($LASTEXITCODE -ne 0) -or (-not (Test-Path ./target/cryptomator-cli))) { throw "Binary creation with jpackage failed with exit code $LASTEXITCODE." diff --git a/dist/jlink.args b/dist/jlink.args new file mode 100644 index 0000000..4f9046f --- /dev/null +++ b/dist/jlink.args @@ -0,0 +1,8 @@ +--verbose +--output target/runtime +--add-modules java.base,java.compiler,java.naming,java.xml +--strip-native-commands +--no-header-files +--no-man-pages +--strip-debug +--compress zip-6 \ No newline at end of file From 0571f6ff0afddb11d5791800534b2b65a64676ca Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Nov 2024 15:19:28 +0100 Subject: [PATCH 3/7] use envsubst to generalize options more --- build_linux.sh | 9 ++++++--- build_mac.sh | 9 ++++++--- build_win.ps1 | 15 +++++++++++---- dist/jpackage.args | 9 +++++++-- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/build_linux.sh b/build_linux.sh index 41b4409..70f179f 100644 --- a/build_linux.sh +++ b/build_linux.sh @@ -3,6 +3,8 @@ set -euxo pipefail echo "Building cryptomator cli..." +APP_VERSION='0.1.0-local' + # Check if Maven is installed if ! command -v mvn &> /dev/null; then echo "Maven is not installed. Please install Maven to proceed." @@ -52,10 +54,11 @@ if (echo "$_OS" | grep -q "Linux.*") ; then fi fi +JP_APP_VERSION='99.9.9' +envsubst < dist/jpackage.args > target/jpackage.args + echo "Creating app binary with jpackage..." -"$JAVA_HOME/bin/jpackage" \ - '@./dist/jpackage.args' \ - --java-options "--enable-native-access=${NATIVE_ACCESS_PACKAGE}" +"$JAVA_HOME/bin/jpackage" '@./target/jpackage.args' if [ $? -ne 0 ] || [ ! -d ./target/cryptomator-cli ]; then echo "Binary creation with jpackage failed." diff --git a/build_mac.sh b/build_mac.sh index 8c7b6b9..b896a45 100644 --- a/build_mac.sh +++ b/build_mac.sh @@ -2,6 +2,8 @@ echo "Building cryptomator cli..." +APP_VERSION='0.1.0-local' + # Check if Maven is installed if ! command -v mvn &> /dev/null; then echo "Maven is not installed. Please install Maven to proceed." @@ -37,10 +39,11 @@ if [ $? -ne 0 ] || [ ! -d ./target/runtime ]; then exit 1 fi +JP_APP_VERSION='99.9.9' +envsubst < dist/jpackage.args > target/jpackage.args + echo "Creating app binary with jpackage..." -"$JAVA_HOME/bin/jpackage" \ - '@./dist/jpackage.args' \ - --java-options "--enable-native-access=org.cryptomator.jfuse.mac" +"$JAVA_HOME/bin/jpackage" '@./target/jpackage.args' if [ $? -ne 0 ] || [ ! -d ./target/cryptomator-cli.app ]; then echo "Binary creation with jpackage failed." diff --git a/build_win.ps1 b/build_win.ps1 index c4bc6cf..b6474c2 100644 --- a/build_win.ps1 +++ b/build_win.ps1 @@ -1,5 +1,7 @@ "Building cryptomator cli..." +$appVersion='0.1.0-local' + # Check if maven is installed $commands = 'mvn' foreach ($cmd in $commands) { @@ -32,13 +34,18 @@ if ( ($LASTEXITCODE -ne 0) -or (-not (Test-Path ./target/runtime))) { throw "JRE creation with jLink failed with exit code $LASTEXITCODE." } +## powershell does not have envsubst +$jpAppVersion='99.9.9' +Get-Content -Path './dist/jpackage.args' | ForEach-Object { + $_.Replace('${APP_VERSION}', $appVersion) + .Replace('${JP_APP_VERSION}', $jpAppVersion) + .Replace('${NATIVE_ACCESS_PACKAGE}', 'org.cryptomator.jfuse.win') +} | Out-File -FilePath './target/jpackage.args' + # jpackage # app-version is hard coded, since the script is only for local test builds Write-Host "Creating app binary with jpackage..." -& $env:JAVA_HOME/bin/jpackage ` - `@./dist/jpackage.args ` - --java-options "--enable-native-access=org.cryptomator.jfuse.win" ` - --win-console +& $env:JAVA_HOME/bin/jpackage `@./target/jpackage.args --win-console if ( ($LASTEXITCODE -ne 0) -or (-not (Test-Path ./target/cryptomator-cli))) { throw "Binary creation with jpackage failed with exit code $LASTEXITCODE." diff --git a/dist/jpackage.args b/dist/jpackage.args index c8c5c7f..599212f 100644 --- a/dist/jpackage.args +++ b/dist/jpackage.args @@ -1,3 +1,7 @@ +# Contains three env vars: +# JP_APP_VERSION: The version needed for jpackage. This version _must_ follow the scheme Y.X.X, where Y >= 1 and X >=0 +# APP_VERSION: The actual, semantic version displayed in the cli app +# NATIVE_ACCESS_PACKAGE: The java package containing the fuse bindings for the system --verbose --type app-image --runtime-image target/runtime @@ -8,8 +12,9 @@ --name cryptomator-cli --vendor "Skymatic GmbH" --copyright "(C) 2016 - 2024 Skymatic GmbH" ---app-version "99.9.9" ---java-options "-Dorg.cryptomator.cli.version=0.1.0-local" +--app-version "${JP_APP_VERSION}" +--java-options "-Dorg.cryptomator.cli.version=${APP_VERSION}" +--java-options "--enable-native-access=${NATIVE_ACCESS_PACKAGE}" --java-options "-Xss5m" --java-options "-Xmx256m" --java-options "-Dfile.encoding=\"utf-8\"" \ No newline at end of file From 83f08b030317d9ab82528dd8462448ecf75f6fb3 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Nov 2024 15:31:25 +0100 Subject: [PATCH 4/7] also adjust jlink to use envsubst --- build_linux.sh | 5 ++--- build_mac.sh | 5 ++--- build_win.ps1 | 11 +++++------ dist/jlink.args | 1 + 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/build_linux.sh b/build_linux.sh index 70f179f..c2551e3 100644 --- a/build_linux.sh +++ b/build_linux.sh @@ -31,9 +31,8 @@ cp ./LICENSE.txt ./target/ mv ./target/cryptomator-cli-*.jar ./target/mods echo "Creating JRE with jlink..." -"$JAVA_HOME/bin/jlink" \ - '@./dist/jlink.args' \ - --module-path "${JAVA_HOME}/jmods" +envsubst < dist/jlink.args > target/jlink.args +"$JAVA_HOME/bin/jlink" '@./target/jlink.args' if [ $? -ne 0 ] || [ ! -d ./target/runtime ]; then echo "JRE creation with jlink failed." diff --git a/build_mac.sh b/build_mac.sh index b896a45..15d33e4 100644 --- a/build_mac.sh +++ b/build_mac.sh @@ -30,9 +30,8 @@ cp ./LICENSE.txt ./target/ mv ./target/cryptomator-cli-*.jar ./target/mods echo "Creating JRE with jlink..." -"$JAVA_HOME/bin/jlink" \ - '@./dist/jlink.args' \ - --module-path "${JAVA_HOME}/jmods" +envsubst < dist/jlink.args > target/jlink.args +"$JAVA_HOME/bin/jlink" '@./target/jlink.args' if [ $? -ne 0 ] || [ ! -d ./target/runtime ]; then echo "JRE creation with jlink failed." diff --git a/build_win.ps1 b/build_win.ps1 index b6474c2..6ee9772 100644 --- a/build_win.ps1 +++ b/build_win.ps1 @@ -26,9 +26,8 @@ Copy-Item ./LICENSE.txt -Destination ./target -ErrorAction Stop Move-Item ./target/cryptomator-cli-*.jar ./target/mods -ErrorAction Stop Write-Host "Creating JRE with jlink..." -& $env:JAVA_HOME/bin/jlink ` - `@./dist/jlink.args ` - --module-path "${env:JAVA_HOME}/jmods" +Get-Content -Path './dist/jlink.args' | ForEach-Object { $_.Replace('${JAVA_HOME}', "$env:JAVA_HOME")} | Out-File -FilePath './target/jlink.args' +& $env:JAVA_HOME/bin/jlink `@./target/jlink.args if ( ($LASTEXITCODE -ne 0) -or (-not (Test-Path ./target/runtime))) { throw "JRE creation with jLink failed with exit code $LASTEXITCODE." @@ -37,9 +36,9 @@ if ( ($LASTEXITCODE -ne 0) -or (-not (Test-Path ./target/runtime))) { ## powershell does not have envsubst $jpAppVersion='99.9.9' Get-Content -Path './dist/jpackage.args' | ForEach-Object { - $_.Replace('${APP_VERSION}', $appVersion) - .Replace('${JP_APP_VERSION}', $jpAppVersion) - .Replace('${NATIVE_ACCESS_PACKAGE}', 'org.cryptomator.jfuse.win') + $_.Replace('${APP_VERSION}', $appVersion). + Replace('${JP_APP_VERSION}', $jpAppVersion). + Replace('${NATIVE_ACCESS_PACKAGE}', 'org.cryptomator.jfuse.win') } | Out-File -FilePath './target/jpackage.args' # jpackage diff --git a/dist/jlink.args b/dist/jlink.args index 4f9046f..c42f03f 100644 --- a/dist/jlink.args +++ b/dist/jlink.args @@ -1,4 +1,5 @@ --verbose +--module-path "${JAVA_HOME}/jmods" --output target/runtime --add-modules java.base,java.compiler,java.naming,java.xml --strip-native-commands From 903600004e0e7e0cff8d488dd349e053715d978e Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Nov 2024 15:39:19 +0100 Subject: [PATCH 5/7] also use envsubst in ci workflow [skip ci] --- .github/workflows/build-linux.yml | 39 ++++++++---------------------- .github/workflows/build-mac.yml | 39 ++++++++---------------------- .github/workflows/build-win.yml | 40 ++++++++----------------------- 3 files changed, 30 insertions(+), 88 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index ee16919..c55e8c8 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -77,36 +77,17 @@ jobs: cp LICENSE.txt target cp target/cryptomator-*.jar target/mods - name: Run jlink - run: > - "${JAVA_HOME}/bin/jlink" - --verbose - --output target/runtime - --module-path "${JAVA_HOME}/jmods" - --add-modules java.base,java.compiler,java.naming,java.xml - --strip-native-commands - --no-header-files - --no-man-pages - --strip-debug - --compress zip-6 + run: | + envsubst < dist/jlink.args > target/jlink.args + "${JAVA_HOME}/bin/jlink" '@./target/jlink.args' - name: Run jpackage - run: > - "${JAVA_HOME}/bin/jpackage" - --verbose - --type app-image - --runtime-image target/runtime - --input target/libs - --module-path target/mods - --module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli - --dest target - --name cryptomator-cli - --vendor "Skymatic GmbH" - --copyright "(C) 2016 - 2024 Skymatic GmbH" - --app-version "${{ needs.prepare.outputs.semVerNum }}" - --java-options "-Dorg.cryptomator.cli.version=${{ needs.prepare.outputs.semVerStr }}" - --java-options "--enable-native-access=${{ matrix.native-access-lib }}" - --java-options "-Xss5m" - --java-options "-Xmx256m" - --java-options "-Dfile.encoding=\"utf-8\"" + run: | + envsubst < dist/jpackage.args > target/jpackage.args + "${JAVA_HOME}/bin/jpackage" '@./target/jpackage.args' --win-console + env: + JP_APP_VERSION: ${{ needs.prepare.outputs.semVerNum }} + APP_VERSION: ${{ needs.prepare.outputs.semVerStr }} + NATIVE_ACCESS_PACKAGE: ${{ matrix.native-access-lib }} - uses: actions/upload-artifact@v4 with: name: cryptomator-cli-linux-${{ matrix.architecture }} diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index b14d5f0..46534be 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -75,36 +75,17 @@ jobs: cp LICENSE.txt target cp target/cryptomator-*.jar target/mods - name: Run jlink - run: > - "${JAVA_HOME}/bin/jlink" - --verbose - --output target/runtime - --module-path "${JAVA_HOME}/jmods" - --add-modules java.base,java.compiler,java.naming,java.xml - --strip-native-commands - --no-header-files - --no-man-pages - --strip-debug - --compress zip-6 + run: | + envsubst < dist/jlink.args > target/jlink.args + "${JAVA_HOME}/bin/jlink" '@./target/jlink.args' - name: Run jpackage - run: > - "${JAVA_HOME}/bin/jpackage" - --verbose - --type app-image - --runtime-image target/runtime - --input target/libs - --module-path target/mods - --module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli - --dest target - --name cryptomator-cli - --vendor "Skymatic GmbH" - --copyright "(C) 2016 - 2024 Skymatic GmbH" - --app-version "${{ needs.prepare.outputs.semVerNum }}" - --java-options "-Dorg.cryptomator.cli.version=${{ needs.prepare.outputs.semVerStr }}" - --java-options "--enable-native-access=org.cryptomator.jfuse.mac" - --java-options "-Xss5m" - --java-options "-Xmx256m" - --java-options "-Dfile.encoding=\"utf-8\"" + run: | + envsubst < dist/jpackage.args > target/jpackage.args + "${JAVA_HOME}/bin/jpackage" '@./target/jpackage.args' --win-console + env: + JP_APP_VERSION: ${{ needs.prepare.outputs.semVerNum }} + APP_VERSION: ${{ needs.prepare.outputs.semVerStr }} + NATIVE_ACCESS_PACKAGE: org.cryptomator.jfuse.mac - uses: actions/upload-artifact@v4 with: name: cryptomator-cli-mac-${{ matrix.architecture }} diff --git a/.github/workflows/build-win.yml b/.github/workflows/build-win.yml index ac1ff6c..639ba44 100644 --- a/.github/workflows/build-win.yml +++ b/.github/workflows/build-win.yml @@ -67,37 +67,17 @@ jobs: cp LICENSE.txt target cp target/cryptomator-*.jar target/mods - name: Run jlink - run: > - "${JAVA_HOME}/bin/jlink" - --verbose - --output target/runtime - --module-path "${JAVA_HOME}/jmods" - --add-modules java.base,java.compiler,java.naming,java.xml - --strip-native-commands - --no-header-files - --no-man-pages - --strip-debug - --compress zip-6 + run: | + envsubst < dist/jlink.args > target/jlink.args + "${JAVA_HOME}/bin/jlink" '@./target/jlink.args' - name: Run jpackage - run: > - "${JAVA_HOME}/bin/jpackage" - --verbose - --type app-image - --runtime-image target/runtime - --input target/libs - --module-path target/mods - --module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli - --dest target - --name cryptomator-cli - --vendor "Skymatic GmbH" - --copyright "(C) 2016 - 2024 Skymatic GmbH" - --app-version "${{ needs.prepare.outputs.semVerNum }}" - --java-options "-Dorg.cryptomator.cli.version=${{ needs.prepare.outputs.semVerStr }}" - --java-options "--enable-native-access=org.cryptomator.jfuse.win" - --java-options "-Xss5m" - --java-options "-Xmx256m" - --java-options "-Dfile.encoding=\"utf-8\"" - --win-console + run: | + envsubst < dist/jpackage.args > target/jpackage.args + "${JAVA_HOME}/bin/jpackage" '@./target/jpackage.args' --win-console + env: + JP_APP_VERSION: ${{ needs.prepare.outputs.semVerNum }} + APP_VERSION: ${{ needs.prepare.outputs.semVerStr }} + NATIVE_ACCESS_PACKAGE: org.cryptomator.jfuse.win - uses: actions/upload-artifact@v4 with: name: cryptomator-cli-win-x64 From 206a572f095bada31f98e393f05fc9bc8c3fc345 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Nov 2024 15:47:40 +0100 Subject: [PATCH 6/7] remove illegal option --- .github/workflows/build-linux.yml | 2 +- .github/workflows/build-mac.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index c55e8c8..ca85d8e 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -83,7 +83,7 @@ jobs: - name: Run jpackage run: | envsubst < dist/jpackage.args > target/jpackage.args - "${JAVA_HOME}/bin/jpackage" '@./target/jpackage.args' --win-console + "${JAVA_HOME}/bin/jpackage" '@./target/jpackage.args' env: JP_APP_VERSION: ${{ needs.prepare.outputs.semVerNum }} APP_VERSION: ${{ needs.prepare.outputs.semVerStr }} diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index 46534be..539aa4c 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -81,7 +81,7 @@ jobs: - name: Run jpackage run: | envsubst < dist/jpackage.args > target/jpackage.args - "${JAVA_HOME}/bin/jpackage" '@./target/jpackage.args' --win-console + "${JAVA_HOME}/bin/jpackage" '@./target/jpackage.args' env: JP_APP_VERSION: ${{ needs.prepare.outputs.semVerNum }} APP_VERSION: ${{ needs.prepare.outputs.semVerStr }} From 4387c9e23207195acfad6bf617d0b4fcf7933397 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Nov 2024 16:18:47 +0100 Subject: [PATCH 7/7] export vars to environment in order to be used be envsubst --- build_linux.sh | 6 +++--- build_mac.sh | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build_linux.sh b/build_linux.sh index c2551e3..d1be9cc 100644 --- a/build_linux.sh +++ b/build_linux.sh @@ -3,7 +3,7 @@ set -euxo pipefail echo "Building cryptomator cli..." -APP_VERSION='0.1.0-local' +export APP_VERSION='0.1.0-local' # Check if Maven is installed if ! command -v mvn &> /dev/null; then @@ -39,7 +39,7 @@ if [ $? -ne 0 ] || [ ! -d ./target/runtime ]; then exit 1 fi -NATIVE_ACCESS_PACKAGE="no.native.access.available" +export NATIVE_ACCESS_PACKAGE="no.native.access.available" _OS=$(uname -s) if (echo "$_OS" | grep -q "Linux.*") ; then _ARCH=$(uname -m) @@ -53,7 +53,7 @@ if (echo "$_OS" | grep -q "Linux.*") ; then fi fi -JP_APP_VERSION='99.9.9' +export JP_APP_VERSION='99.9.9' envsubst < dist/jpackage.args > target/jpackage.args echo "Creating app binary with jpackage..." diff --git a/build_mac.sh b/build_mac.sh index 15d33e4..a46b5c5 100644 --- a/build_mac.sh +++ b/build_mac.sh @@ -2,7 +2,7 @@ echo "Building cryptomator cli..." -APP_VERSION='0.1.0-local' +export APP_VERSION='0.1.0-local' # Check if Maven is installed if ! command -v mvn &> /dev/null; then @@ -38,7 +38,8 @@ if [ $? -ne 0 ] || [ ! -d ./target/runtime ]; then exit 1 fi -JP_APP_VERSION='99.9.9' +export JP_APP_VERSION='99.9.9' +export NATIVE_ACCESS_PACKAGE="org.cryptomator.jfuse.mac" envsubst < dist/jpackage.args > target/jpackage.args echo "Creating app binary with jpackage..."