Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
1a5b183
add maven wrapper
infeo Aug 26, 2024
52543c2
remove old code & prepare pom
infeo Sep 4, 2024
aecf18c
switch to JUL (for now)
infeo Sep 5, 2024
92f3cb3
implement mvp
infeo Sep 13, 2024
ce7936c
update CI
infeo Sep 13, 2024
067d73d
automatically wipe password once used
infeo Sep 18, 2024
f8e3e11
use correct maven property
infeo Sep 18, 2024
60fc1b9
update maven wrapper
infeo Sep 18, 2024
efdbd9b
cleanup
infeo Sep 19, 2024
e935ab3
modularize app
infeo Sep 23, 2024
83538f8
fix error in help message
infeo Sep 24, 2024
702afb5
align password parameters
infeo Sep 24, 2024
3a371e1
clean up pom
infeo Sep 25, 2024
2ad10f2
add maven-exec-plugin
infeo Sep 25, 2024
38d357e
Improve app behaviour:
infeo Sep 25, 2024
dfd562e
Revert "switch to JUL (for now)"
infeo Sep 25, 2024
883359c
colorize console
infeo Sep 25, 2024
2c6a42a
add option to set maxCleartextNameLimit
infeo Sep 25, 2024
6f3ba44
instead of assembled jar, use maven shade plugin to create an uber-jar.
infeo Sep 26, 2024
9e444ec
add verbose logging
infeo Oct 2, 2024
654e620
fix ci
infeo Oct 2, 2024
c2c260f
clean up
infeo Oct 4, 2024
c3421ca
Update README
infeo Oct 4, 2024
03fde0c
remove unsupported docker image
infeo Oct 4, 2024
4a5f9c5
update gitignore
infeo Oct 4, 2024
5efd135
adjust name of shaded jar (for CI integration)
infeo Oct 7, 2024
a561728
cleanup
infeo Oct 7, 2024
a9481f6
removed unused IPC for password input
infeo Oct 7, 2024
897dda7
throw exception if password file is greater than 10KB
infeo Oct 7, 2024
fa0437b
fix password from file source and specify file format
infeo Oct 7, 2024
ee9d0b6
cleanup
infeo Oct 7, 2024
0f9564d
more renaming
infeo Oct 8, 2024
e527dca
use picocli built in way to read from stdin
infeo Oct 10, 2024
1e246c2
generalize logging to be also used in subcommands
infeo Oct 18, 2024
080c17e
introduce "unlock" subcommand
infeo Oct 18, 2024
19735db
remove TODO
infeo Oct 18, 2024
338ddcc
switch from maven shade to jpackage
infeo Oct 23, 2024
e33b1f0
fis binary workflow
infeo Oct 23, 2024
36a7c77
make MountSetup error resistant by using enum constants directly
infeo Oct 24, 2024
63644de
fix build-binary workflow
infeo Oct 24, 2024
c1ea6f2
use a constant for masterkey file name
infeo Oct 24, 2024
92e6db2
fix error in loggingMixin
infeo Oct 24, 2024
087d358
read app version from system property
infeo Oct 24, 2024
bb4dbbd
adjust local build script
infeo Oct 24, 2024
47cb717
add command to list available mounters
infeo Oct 24, 2024
0b378b7
add shell script for unix builds
infeo Nov 5, 2024
480b1a9
use shutdown hook instead of waiting for input
infeo Nov 5, 2024
506b4ad
make build script more robust [ci skip]
infeo Nov 5, 2024
2e5b271
remove unnecessary uses expression in module-info
infeo Nov 5, 2024
d59feca
use os dependent build scripts [ci skip]
infeo Nov 6, 2024
ef40c6b
Update README [ci skip]
infeo Nov 6, 2024
18c74ab
Add section about possible cleanup tasks.
infeo Nov 6, 2024
da44681
use correct version number
infeo Nov 8, 2024
fc34254
improve error handling when loading masterkey
infeo Nov 8, 2024
19409ab
handle correctly unexpected regular app shutdown.
infeo Nov 8, 2024
2ab1e19
follow bash standards
infeo Nov 8, 2024
99f38a7
fix wrong arch variable and use github built in macos 64 runner
infeo Nov 8, 2024
eb812cc
upload release artifacts to release page and add gpg signature
infeo Nov 8, 2024
2060729
make local build scripts more robust
infeo Nov 18, 2024
ded3f90
correct build scripts
infeo Nov 18, 2024
60e53ae
strip new line from end of password file
infeo Nov 18, 2024
c35d317
format pom
infeo Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions .github/workflows/build-binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: Build java app image

on:
release:
types: [published]
workflow_dispatch:
inputs:
sem-version:
description: 'Version'
required: false

permissions:
contents: write
packages: write

env:
JAVA_DIST: 'zulu'
JAVA_VERSION: '22.0.2+9'

defaults:
run:
shell: bash

jobs:
prepare:
name: Determines the versions strings for the binaries
runs-on: [ubuntu-latest]
outputs:
semVerStr: ${{ steps.determine-version.outputs.version }}
semVerNum: ${{steps.determine-number.outputs.number}}
steps:
- id: determine-version
shell: pwsh
run: |
if ( ${{github.event_name}} -eq 'release') {
echo "version=${{ github.event.release.tag_name}}" >> "$GITHUB_OUTPUT"
exit 0
} else if (${{inputs.sem-version}}) {
echo "version=${{ inputs.sem-version}}" >> "$GITHUB_OUTPUT"
exit 0
}
Write-Error "Version neither via input nor by tag specified. Aborting"
exit 1
- id: determine-number
run: |
SEM_VER_NUM=$(echo "${{ steps.determine-version.outputs.version }}" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
echo "number=${SEM_VER_NUM}" >> "$GITHUB_OUTPUT"

build-binary:
name: Build java app image
needs: [prepare]
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
architecture: x64
native-access-lib: 'org.cryptomator.jfuse.linux.amd64'
binary-dir-suffix: ""
- os: [self-hosted, Linux, ARM64]
architecture: aarch64
native-access-lib: 'org.cryptomator.jfuse.linux.aarch64'
binary-dir-suffix: ""
- os: macos-latest-large
architecture: x64
native-access-lib: 'org.cryptomator.jfuse.mac'
binary-dir-suffix: ".app"
- os: macos-latest
architecture: aarch64
native-access-lib: 'org.cryptomator.jfuse.mac'
binary-dir-suffix: ".app"
- os: windows-latest
architecture: x64
native-access-lib: 'org.cryptomator.jfuse.win'
binary-dir-suffix: ""
runs-on: ${{ matrix.os }}
steps:
- name: Preparations fpr windows runner
if: startsWith(matrix.os, 'windows')
run: echo "JPACKAGE_OS_OPTS=--win-console" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'zulu'
- name: Set version
run: mvn versions:set -DnewVersion=${{ needs.prepare.outputs.semVerStr }}
- name: Run maven
run: mvn -B clean package -Pwin -DskipTests
- name: Patch target dir
run: |
cp LICENSE.txt target
cp target/cryptomator-*.jar target/mods
- name: Run jlink
shell: pwsh
run: >
& $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-6
- name: Run jpackage
shell: pwsh
run: >
& $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 "${{ needs.prepare.outputs.semVerNum }}"
--java-options "-Dorg.cryptomator.cli.version=${{ needs.prepare.outputs.semVerStr }}"
--java-options "--enable-preview"
--java-options "--enable-native-access=${{ matrix.native-access-lib }}"
--java-options "-Xss5m"
--java-options "-Xmx256m"
--java-options '-Dfile.encoding="utf-8"'
${JPACKAGE_OS_OPTS}
- uses: actions/upload-artifact@v4
with:
path: ./target/cryptomator-cli${{ matrix.binary-dir-suffix }}
if-no-files-found: error
- name: Zip binary for release
if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published'
shell: pwsh
run: Compress-Archive -Path .\target\cryptomator-cli${{ matrix.binary-dir-suffix }} -DestinationPath .\cryptomator-cli-${{ needs.prepare.outputs.semVerStr }}.zip
- name: Create detached GPG signature with key 615D449FE6E6A235
run: |
echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a ./cryptomator-cli-${{ needs.prepare.outputs.semVerStr }}.zip
env:
GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
- name: Publish artefact on GitHub Releases
if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published'
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
files: |
cryptomator-cli-${{ needs.prepare.outputs.semVerStr }}.zip
cryptomator-cli-*.asc

57 changes: 12 additions & 45 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,66 +7,33 @@ jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
#This check is case insensitive
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
outputs:
artifactVersion: ${{ steps.setversion.outputs.version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 17
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
java-version: '22'
distribution: 'temurin'
- name: Ensure to use tagged version
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/} # use shell parameter expansion to strip of 'refs/tags'
if: startsWith(github.ref, 'refs/tags/')
- name: Output project version
id: setversion
run: |
BUILD_VERSION=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
echo "::set-output name=version::${BUILD_VERSION}"
echo "version=${BUILD_VERSION}" >> "$GITHUB_OUTPUT"
- name: Build and Test
run: mvn -B install
- name: Upload artifact cryptomator-cli-${{ steps.setversion.outputs.version }}.jar
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: cryptomator-cli-${{ steps.setversion.outputs.version }}.jar
path: target/cryptomator-cli-*.jar

release:
name: Draft a Release on GitHub Releases and uploads the build artifacts to it
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download cryptomator-cli.jar
uses: actions/download-artifact@v1
with:
name: cryptomator-cli-${{ needs.build.outputs.artifactVersion }}.jar
path: .
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
:construction: Work in Progress
draft: true
prerelease: false
- name: Upload cryptomator-cli-${{ needs.build.outputs.artifactVersion }}.jar to GitHub Releases
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: cryptomator-cli-${{ needs.build.outputs.artifactVersion }}.jar
asset_name: cryptomator-cli-${{ needs.build.outputs.artifactVersion }}.jar
asset_content_type: application/jar
token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
generate_release_notes: true
draft: true
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ out/
.idea_modules/
*.iws

*.iml
*.iml

#mvn shade plugin artifact
dependency-reduced-pom.xml
19 changes: 19 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
13 changes: 0 additions & 13 deletions Dockerfile

This file was deleted.

Loading