Skip to content

Commit 2a517ae

Browse files
committed
Merge branch 'develop' into feature/sign-build-artifacts
# Conflicts: # .github/workflows/build-mac.yml # .github/workflows/build-win.yml
2 parents 5e5ec76 + 1a907ca commit 2a517ae

File tree

9 files changed

+101
-182
lines changed

9 files changed

+101
-182
lines changed

.github/workflows/build-linux.yml

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -77,36 +77,17 @@ jobs:
7777
cp LICENSE.txt target
7878
cp target/cryptomator-*.jar target/mods
7979
- name: Run jlink
80-
run: >
81-
"${JAVA_HOME}/bin/jlink"
82-
--verbose
83-
--output target/runtime
84-
--module-path "${JAVA_HOME}/jmods"
85-
--add-modules java.base,java.compiler,java.naming,java.xml
86-
--strip-native-commands
87-
--no-header-files
88-
--no-man-pages
89-
--strip-debug
90-
--compress zip-6
80+
run: |
81+
envsubst < dist/jlink.args > target/jlink.args
82+
"${JAVA_HOME}/bin/jlink" '@./target/jlink.args'
9183
- name: Run jpackage
92-
run: >
93-
"${JAVA_HOME}/bin/jpackage"
94-
--verbose
95-
--type app-image
96-
--runtime-image target/runtime
97-
--input target/libs
98-
--module-path target/mods
99-
--module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli
100-
--dest target
101-
--name cryptomator-cli
102-
--vendor "Skymatic GmbH"
103-
--copyright "(C) 2016 - 2024 Skymatic GmbH"
104-
--app-version "${{ needs.prepare.outputs.semVerNum }}"
105-
--java-options "-Dorg.cryptomator.cli.version=${{ needs.prepare.outputs.semVerStr }}"
106-
--java-options "--enable-native-access=${{ matrix.native-access-lib }}"
107-
--java-options "-Xss5m"
108-
--java-options "-Xmx256m"
109-
--java-options "-Dfile.encoding=\"utf-8\""
84+
run: |
85+
envsubst < dist/jpackage.args > target/jpackage.args
86+
"${JAVA_HOME}/bin/jpackage" '@./target/jpackage.args'
87+
env:
88+
JP_APP_VERSION: ${{ needs.prepare.outputs.semVerNum }}
89+
APP_VERSION: ${{ needs.prepare.outputs.semVerStr }}
90+
NATIVE_ACCESS_PACKAGE: ${{ matrix.native-access-lib }}
11091
- uses: actions/upload-artifact@v4
11192
with:
11293
name: cryptomator-cli-linux-${{ matrix.architecture }}

.github/workflows/build-mac.yml

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -82,36 +82,22 @@ jobs:
8282
cp LICENSE.txt target
8383
cp target/cryptomator-*.jar target/mods
8484
- name: Run jlink
85-
run: >
86-
"${JAVA_HOME}/bin/jlink"
87-
--verbose
88-
--output target/runtime
89-
--module-path "${JAVA_HOME}/jmods"
90-
--add-modules java.base,java.compiler,java.naming,java.xml
91-
--strip-native-commands
92-
--no-header-files
93-
--no-man-pages
94-
--strip-debug
95-
--compress zip-6
85+
run: |
86+
envsubst < dist/jlink.args > target/jlink.args
87+
"${JAVA_HOME}/bin/jlink" '@./target/jlink.args'
9688
- name: Run jpackage
97-
run: >
98-
"${JAVA_HOME}/bin/jpackage"
99-
--verbose
100-
--type app-image
101-
--runtime-image target/runtime
102-
--input target/libs
103-
--module-path target/mods
104-
--module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli
105-
--dest target
106-
--name cryptomator-cli
107-
--vendor "Skymatic GmbH"
108-
--copyright "(C) 2016 - 2024 Skymatic GmbH"
109-
--app-version "${{ needs.prepare.outputs.semVerNum }}"
110-
--java-options "-Dorg.cryptomator.cli.version=${{ needs.prepare.outputs.semVerStr }}"
111-
--java-options "--enable-native-access=org.cryptomator.jfuse.mac"
112-
--java-options "-Xss5m"
113-
--java-options "-Xmx256m"
114-
--java-options "-Dfile.encoding=\"utf-8\""
89+
run: |
90+
envsubst < dist/jpackage.args > target/jpackage.args
91+
"${JAVA_HOME}/bin/jpackage" '@./target/jpackage.args'
92+
env:
93+
JP_APP_VERSION: ${{ needs.prepare.outputs.semVerNum }}
94+
APP_VERSION: ${{ needs.prepare.outputs.semVerStr }}
95+
NATIVE_ACCESS_PACKAGE: org.cryptomator.jfuse.mac
96+
- uses: actions/upload-artifact@v4
97+
with:
98+
name: cryptomator-cli-mac-${{ matrix.architecture }}
99+
path: ./target/cryptomator-cli.app
100+
if-no-files-found: error
115101
- name: Patch .app dir
116102
run: |
117103
sed -i '' "s|###BUNDLE_SHORT_VERSION_STRING###|${VERSION_NO}|g" ./target/cryptomator-cli.app/Contents/Info.plist
@@ -234,5 +220,4 @@ jobs:
234220
token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
235221
files: |
236222
${{ matrix.artifact-name }}
237-
cryptomator-cli-*.asc
238-
223+
cryptomator-cli-*.asc

.github/workflows/build-win.yml

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -67,37 +67,17 @@ jobs:
6767
cp LICENSE.txt target
6868
cp target/cryptomator-*.jar target/mods
6969
- name: Run jlink
70-
run: >
71-
"${JAVA_HOME}/bin/jlink"
72-
--verbose
73-
--output target/runtime
74-
--module-path "${JAVA_HOME}/jmods"
75-
--add-modules java.base,java.compiler,java.naming,java.xml
76-
--strip-native-commands
77-
--no-header-files
78-
--no-man-pages
79-
--strip-debug
80-
--compress zip-6
70+
run: |
71+
envsubst < dist/jlink.args > target/jlink.args
72+
"${JAVA_HOME}/bin/jlink" '@./target/jlink.args'
8173
- name: Run jpackage
82-
run: >
83-
"${JAVA_HOME}/bin/jpackage"
84-
--verbose
85-
--type app-image
86-
--runtime-image target/runtime
87-
--input target/libs
88-
--module-path target/mods
89-
--module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli
90-
--dest target
91-
--name cryptomator-cli
92-
--vendor "Skymatic GmbH"
93-
--copyright "(C) 2016 - 2024 Skymatic GmbH"
94-
--app-version "${{ needs.prepare.outputs.semVerNum }}"
95-
--java-options "-Dorg.cryptomator.cli.version=${{ needs.prepare.outputs.semVerStr }}"
96-
--java-options "--enable-native-access=org.cryptomator.jfuse.win"
97-
--java-options "-Xss5m"
98-
--java-options "-Xmx256m"
99-
--java-options "-Dfile.encoding=\"utf-8\""
100-
--win-console
74+
run: |
75+
envsubst < dist/jpackage.args > target/jpackage.args
76+
"${JAVA_HOME}/bin/jpackage" '@./target/jpackage.args' --win-console
77+
env:
78+
JP_APP_VERSION: ${{ needs.prepare.outputs.semVerNum }}
79+
APP_VERSION: ${{ needs.prepare.outputs.semVerStr }}
80+
NATIVE_ACCESS_PACKAGE: org.cryptomator.jfuse.win
10181
- name: Fix permissions
10282
run: attrib -r target/cryptomator-cli/cryptomator-cli.exe
10383
shell: pwsh

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Afterward, you can directly run Cryptomator-CLI by calling the binary, e.g. on L
2525

2626
To unmount, send a SIGTERM signal to the process, e.g. by pressing CTRL+C (macOS: CMD+C) in the terminal.
2727

28-
For a complete list of options, use the`--help` option.
28+
For a complete list of options, use the `--help` option.
2929
```shell
30-
cryptomator-cli --help`
30+
cryptomator-cli --help
3131
```
3232

3333
## Filesystem Integration

build_linux.sh

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ set -euxo pipefail
33

44
echo "Building cryptomator cli..."
55

6+
export APP_VERSION='0.1.0-local'
7+
68
# Check if Maven is installed
79
if ! command -v mvn &> /dev/null; then
810
echo "Maven is not installed. Please install Maven to proceed."
@@ -29,23 +31,15 @@ cp ./LICENSE.txt ./target/
2931
mv ./target/cryptomator-cli-*.jar ./target/mods
3032

3133
echo "Creating JRE with jlink..."
32-
"$JAVA_HOME/bin/jlink" \
33-
--verbose \
34-
--output target/runtime \
35-
--module-path "${JAVA_HOME}/jmods" \
36-
--add-modules java.base,java.compiler,java.naming,java.xml \
37-
--strip-native-commands \
38-
--no-header-files \
39-
--no-man-pages \
40-
--strip-debug \
41-
--compress zip-0
34+
envsubst < dist/jlink.args > target/jlink.args
35+
"$JAVA_HOME/bin/jlink" '@./target/jlink.args'
4236

4337
if [ $? -ne 0 ] || [ ! -d ./target/runtime ]; then
4438
echo "JRE creation with jlink failed."
4539
exit 1
4640
fi
4741

48-
NATIVE_ACCESS_PACKAGE="no.native.access.available"
42+
export NATIVE_ACCESS_PACKAGE="no.native.access.available"
4943
_OS=$(uname -s)
5044
if (echo "$_OS" | grep -q "Linux.*") ; then
5145
_ARCH=$(uname -m)
@@ -59,25 +53,11 @@ if (echo "$_OS" | grep -q "Linux.*") ; then
5953
fi
6054
fi
6155

56+
export JP_APP_VERSION='99.9.9'
57+
envsubst < dist/jpackage.args > target/jpackage.args
58+
6259
echo "Creating app binary with jpackage..."
63-
"$JAVA_HOME/bin/jpackage" \
64-
--verbose \
65-
--type app-image \
66-
--runtime-image target/runtime \
67-
--input target/libs \
68-
--module-path target/mods \
69-
--module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli \
70-
--dest target \
71-
--name cryptomator-cli \
72-
--vendor "Skymatic GmbH" \
73-
--copyright "(C) 2016 - 2024 Skymatic GmbH" \
74-
--app-version "0.0.1.0" \
75-
--java-options "-Dorg.cryptomator.cli.version=0.0.1-local" \
76-
--java-options "--enable-preview" \
77-
--java-options "--enable-native-access=${NATIVE_ACCESS_PACKAGE}" \
78-
--java-options "-Xss5m" \
79-
--java-options "-Xmx256m" \
80-
--java-options "-Dfile.encoding=utf-8" \
60+
"$JAVA_HOME/bin/jpackage" '@./target/jpackage.args'
8161

8262
if [ $? -ne 0 ] || [ ! -d ./target/cryptomator-cli ]; then
8363
echo "Binary creation with jpackage failed."

build_mac.sh

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
echo "Building cryptomator cli..."
44

5+
export APP_VERSION='0.1.0-local'
6+
57
# Check if Maven is installed
68
if ! command -v mvn &> /dev/null; then
79
echo "Maven is not installed. Please install Maven to proceed."
@@ -28,41 +30,20 @@ cp ./LICENSE.txt ./target/
2830
mv ./target/cryptomator-cli-*.jar ./target/mods
2931

3032
echo "Creating JRE with jlink..."
31-
"$JAVA_HOME/bin/jlink" \
32-
--verbose \
33-
--output target/runtime \
34-
--module-path "${JAVA_HOME}/jmods" \
35-
--add-modules java.base,java.compiler,java.naming,java.xml \
36-
--strip-native-commands \
37-
--no-header-files \
38-
--no-man-pages \
39-
--strip-debug \
40-
--compress zip-0
33+
envsubst < dist/jlink.args > target/jlink.args
34+
"$JAVA_HOME/bin/jlink" '@./target/jlink.args'
4135

4236
if [ $? -ne 0 ] || [ ! -d ./target/runtime ]; then
4337
echo "JRE creation with jlink failed."
4438
exit 1
4539
fi
4640

41+
export JP_APP_VERSION='99.9.9'
42+
export NATIVE_ACCESS_PACKAGE="org.cryptomator.jfuse.mac"
43+
envsubst < dist/jpackage.args > target/jpackage.args
44+
4745
echo "Creating app binary with jpackage..."
48-
"$JAVA_HOME/bin/jpackage" \
49-
--verbose \
50-
--type app-image \
51-
--runtime-image target/runtime \
52-
--input target/libs \
53-
--module-path target/mods \
54-
--module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli \
55-
--dest target \
56-
--name cryptomator-cli \
57-
--vendor "Skymatic GmbH" \
58-
--copyright "(C) 2016 - 2024 Skymatic GmbH" \
59-
--app-version "99.9.9" \
60-
--java-options "-Dorg.cryptomator.cli.version=0.0.1-local" \
61-
--java-options "--enable-preview" \
62-
--java-options "--enable-native-access=org.cryptomator.jfuse.mac" \
63-
--java-options "-Xss5m" \
64-
--java-options "-Xmx256m" \
65-
--java-options "-Dfile.encoding=utf-8" \
46+
"$JAVA_HOME/bin/jpackage" '@./target/jpackage.args'
6647

6748
if [ $? -ne 0 ] || [ ! -d ./target/cryptomator-cli.app ]; then
6849
echo "Binary creation with jpackage failed."

build_win.ps1

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"Building cryptomator cli..."
22

3+
$appVersion='0.1.0-local'
4+
35
# Check if maven is installed
46
$commands = 'mvn'
57
foreach ($cmd in $commands) {
@@ -12,9 +14,9 @@ if(-not $env:JAVA_HOME) {
1214
}
1315

1416
# Check Java version
15-
$minJavaVersion=$(mvn help:evaluate "-Dexpression=jdk.version" -q -DforceStdout)
17+
$minJavaVersion=[int]$(mvn help:evaluate "-Dexpression=jdk.version" -q -DforceStdout)
1618
$javaVersion = $(& "$env:JAVA_HOME\bin\java" --version) -split ' ' | Select-Object -Index 1
17-
if( ($javaVersion -split '.' | Select-Object -First 1) -ne "22") {
19+
if( ([int] ($javaVersion.Split('.') | Select-Object -First 1)) -lt $minJavaVersion) {
1820
throw "Java version $javaVersion is too old. Minimum required version is $minJavaVersion"
1921
}
2022

@@ -24,43 +26,24 @@ Copy-Item ./LICENSE.txt -Destination ./target -ErrorAction Stop
2426
Move-Item ./target/cryptomator-cli-*.jar ./target/mods -ErrorAction Stop
2527

2628
Write-Host "Creating JRE with jlink..."
27-
& $env:JAVA_HOME/bin/jlink `
28-
--verbose `
29-
--output target/runtime `
30-
--module-path "${env:JAVA_HOME}/jmods" `
31-
--add-modules java.base,java.compiler,java.naming,java.xml `
32-
--strip-native-commands `
33-
--no-header-files `
34-
--no-man-pages `
35-
--strip-debug `
36-
--compress zip-0
29+
Get-Content -Path './dist/jlink.args' | ForEach-Object { $_.Replace('${JAVA_HOME}', "$env:JAVA_HOME")} | Out-File -FilePath './target/jlink.args'
30+
& $env:JAVA_HOME/bin/jlink `@./target/jlink.args
3731

3832
if ( ($LASTEXITCODE -ne 0) -or (-not (Test-Path ./target/runtime))) {
39-
throw "JRE creation with jLink failed with exit code $LASTEXITCODE."
33+
throw "JRE creation with jLink failed with exit code $LASTEXITCODE."
4034
}
4135

36+
## powershell does not have envsubst
37+
$jpAppVersion='99.9.9'
38+
Get-Content -Path './dist/jpackage.args' | ForEach-Object {
39+
$_.Replace('${APP_VERSION}', $appVersion).
40+
Replace('${JP_APP_VERSION}', $jpAppVersion).
41+
Replace('${NATIVE_ACCESS_PACKAGE}', 'org.cryptomator.jfuse.win')
42+
} | Out-File -FilePath './target/jpackage.args'
43+
4244
# jpackage
43-
# app-version is hard coded, since the script is only for local test builds
4445
Write-Host "Creating app binary with jpackage..."
45-
& $env:JAVA_HOME/bin/jpackage `
46-
--verbose `
47-
--type app-image `
48-
--runtime-image target/runtime `
49-
--input target/libs `
50-
--module-path target/mods `
51-
--module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli `
52-
--dest target `
53-
--name cryptomator-cli `
54-
--vendor "Skymatic GmbH" `
55-
--copyright "(C) 2016 - 2024 Skymatic GmbH" `
56-
--app-version "0.0.1.0" `
57-
--java-options "-Dorg.cryptomator.cli.version=0.0.1-local" `
58-
--java-options "--enable-preview" `
59-
--java-options "--enable-native-access=org.cryptomator.jfuse.win" `
60-
--java-options "-Xss5m" `
61-
--java-options "-Xmx256m" `
62-
--java-options '-Dfile.encoding="utf-8"' `
63-
--win-console
46+
& $env:JAVA_HOME/bin/jpackage `@./target/jpackage.args --win-console
6447

6548
if ( ($LASTEXITCODE -ne 0) -or (-not (Test-Path ./target/cryptomator-cli))) {
6649
throw "Binary creation with jpackage failed with exit code $LASTEXITCODE."

dist/jlink.args

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--verbose
2+
--module-path "${JAVA_HOME}/jmods"
3+
--output target/runtime
4+
--add-modules java.base,java.compiler,java.naming,java.xml
5+
--strip-native-commands
6+
--no-header-files
7+
--no-man-pages
8+
--strip-debug
9+
--compress zip-6

dist/jpackage.args

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Contains three env vars:
2+
# JP_APP_VERSION: The version needed for jpackage. This version _must_ follow the scheme Y.X.X, where Y >= 1 and X >=0
3+
# APP_VERSION: The actual, semantic version displayed in the cli app
4+
# NATIVE_ACCESS_PACKAGE: The java package containing the fuse bindings for the system
5+
--verbose
6+
--type app-image
7+
--runtime-image target/runtime
8+
--input target/libs
9+
--module-path target/mods
10+
--module org.cryptomator.cli/org.cryptomator.cli.CryptomatorCli
11+
--dest target
12+
--name cryptomator-cli
13+
--vendor "Skymatic GmbH"
14+
--copyright "(C) 2016 - 2024 Skymatic GmbH"
15+
--app-version "${JP_APP_VERSION}"
16+
--java-options "-Dorg.cryptomator.cli.version=${APP_VERSION}"
17+
--java-options "--enable-native-access=${NATIVE_ACCESS_PACKAGE}"
18+
--java-options "-Xss5m"
19+
--java-options "-Xmx256m"
20+
--java-options "-Dfile.encoding=\"utf-8\""

0 commit comments

Comments
 (0)