1
- name : Build java app image
1
+ name : Java app image Linux
2
2
3
3
on :
4
4
release :
@@ -33,10 +33,10 @@ jobs:
33
33
shell : pwsh
34
34
run : |
35
35
if ( '${{github.event_name}}' -eq 'release') {
36
- echo " version=${{ github.event.release.tag_name}}" >> "$GITHUB_OUTPUT"
36
+ echo ' version=${{ github.event.release.tag_name}}' >> "$env: GITHUB_OUTPUT"
37
37
exit 0
38
38
} elseif ('${{inputs.sem-version}}') {
39
- echo " version=${{ inputs.sem-version}}" >> "$GITHUB_OUTPUT"
39
+ echo ' version=${{ inputs.sem-version}}' >> "$env: GITHUB_OUTPUT"
40
40
exit 0
41
41
}
42
42
Write-Error "Version neither via input nor by tag specified. Aborting"
@@ -56,56 +56,41 @@ jobs:
56
56
- os : ubuntu-latest
57
57
architecture : x64
58
58
native-access-lib : ' org.cryptomator.jfuse.linux.amd64'
59
- binary-dir-suffix : " "
59
+ artifact-name : cryptomator-cli-${{ needs.prepare.outputs.semVerStr }}-linux-x64.zip
60
60
- os : [self-hosted, Linux, ARM64]
61
61
architecture : aarch64
62
62
native-access-lib : ' org.cryptomator.jfuse.linux.aarch64'
63
- binary-dir-suffix : " "
64
- - os : macos-latest-large
65
- architecture : x64
66
- native-access-lib : ' org.cryptomator.jfuse.mac'
67
- binary-dir-suffix : " .app"
68
- - os : macos-latest
69
- architecture : aarch64
70
- native-access-lib : ' org.cryptomator.jfuse.mac'
71
- binary-dir-suffix : " .app"
72
- - os : windows-latest
73
- architecture : x64
74
- native-access-lib : ' org.cryptomator.jfuse.win'
75
- binary-dir-suffix : " "
63
+ artifact-name : cryptomator-cli-${{ needs.prepare.outputs.semVerStr }}-linux-aarch64.zip
76
64
runs-on : ${{ matrix.os }}
77
65
steps :
78
- - name : Preparations for windows runner
79
- if : startsWith(matrix.os, 'windows')
80
- run : echo "JPACKAGE_OS_OPTS=--win-console" >> "$GITHUB_ENV"
81
66
- uses : actions/checkout@v4
82
67
- uses : actions/setup-java@v4
83
68
with :
84
- java-version : ' 22 '
85
- distribution : ' zulu '
69
+ java-version : ${{ env.JAVA_VERSION }}
70
+ distribution : ${{ env.JAVA_DIST }}
86
71
- name : Set version
87
72
run : mvn versions:set -DnewVersion=${{ needs.prepare.outputs.semVerStr }}
88
73
- name : Run maven
89
- run : mvn -B clean package -Pwin - DskipTests
74
+ run : mvn -B clean package -DskipTests
90
75
- name : Patch target dir
91
76
run : |
92
77
cp LICENSE.txt target
93
78
cp target/cryptomator-*.jar target/mods
94
79
- name : Run jlink
95
80
run : >
96
- ${JAVA_HOME}/bin/jlink
81
+ " ${JAVA_HOME}/bin/jlink"
97
82
--verbose
98
83
--output target/runtime
99
84
--module-path "${JAVA_HOME}/jmods"
100
- --add-modules java.base,java.compiler,java.naming,java.xml `
101
- --strip-native-commands `
102
- --no-header-files `
103
- --no-man-pages `
104
- --strip-debug `
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
105
90
--compress zip-6
106
91
- name : Run jpackage
107
92
run : >
108
- ${JAVA_HOME}/bin/jpackage
93
+ " ${JAVA_HOME}/bin/jpackage"
109
94
--verbose
110
95
--type app-image
111
96
--runtime-image target/runtime
@@ -118,23 +103,21 @@ jobs:
118
103
--copyright "(C) 2016 - 2024 Skymatic GmbH"
119
104
--app-version "${{ needs.prepare.outputs.semVerNum }}"
120
105
--java-options "-Dorg.cryptomator.cli.version=${{ needs.prepare.outputs.semVerStr }}"
121
- --java-options "--enable-preview"
122
106
--java-options "--enable-native-access=${{ matrix.native-access-lib }}"
123
107
--java-options "-Xss5m"
124
108
--java-options "-Xmx256m"
125
109
--java-options "-Dfile.encoding=\"utf-8\""
126
- ${JPACKAGE_OS_OPTS}
127
110
- uses : actions/upload-artifact@v4
128
111
with :
129
- path : ./target/cryptomator-cli${{ matrix.binary-dir-suffix }}
112
+ name : cryptomator-cli-linux-${{ matrix.architecture }}
113
+ path : ./target/cryptomator-cli
130
114
if-no-files-found : error
131
115
- name : Zip binary for release
132
- if : startsWith(github.ref, 'refs/tags/') && github.event.action == 'published'
133
- run : zip -r ./target/cryptomator-cli${{ matrix.binary-dir-suffix }} ./cryptomator-cli-${{ needs.prepare.outputs.semVerStr }}.zip
116
+ run : zip -r ./${{ matrix.artifact-name}} ./target/cryptomator-cli
134
117
- name : Create detached GPG signature with key 615D449FE6E6A235
135
118
run : |
136
119
echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
137
- echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a ./cryptomator-cli- ${{ needs.prepare.outputs.semVerStr }}.zip
120
+ echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a ./${{ matrix.artifact-name }}
138
121
env :
139
122
GPG_PRIVATE_KEY : ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
140
123
GPG_PASSPHRASE : ${{ secrets.RELEASES_GPG_PASSPHRASE }}
@@ -145,6 +128,6 @@ jobs:
145
128
fail_on_unmatched_files : true
146
129
token : ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
147
130
files : |
148
- cryptomator-cli- ${{ needs.prepare.outputs.semVerStr }}.zip
131
+ ${{ matrix.artifact-name }}
149
132
cryptomator-cli-*.asc
150
133
0 commit comments