Skip to content

Commit a4908c6

Browse files
Merge branch 'release/1.0.0'
2 parents 376436a + c2d7f52 commit a4908c6

File tree

8 files changed

+218
-43
lines changed

8 files changed

+218
-43
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,38 @@
11
name: Build
2-
32
on:
43
[push]
5-
64
jobs:
75
build:
86
name: Build and Test
97
runs-on: ubuntu-latest
108
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
11-
env:
12-
BUILD_VERSION: SNAPSHOT
13-
outputs:
14-
artifact-version: ${{ steps.setversion.outputs.version }}
159
steps:
1610
- uses: actions/checkout@v2
1711
- uses: actions/setup-java@v1
1812
with:
1913
java-version: 11
20-
server-id: bintray-jcenter
21-
server-username: BINTRAY_USERNAME
22-
server-password: BINTRAY_API_KEY
23-
- uses: actions/cache@v1
14+
- uses: actions/cache@v2
2415
with:
2516
path: ~/.m2/repository
2617
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2718
restore-keys: |
2819
${{ runner.os }}-maven-
2920
- name: Ensure to use tagged version
30-
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
3121
if: startsWith(github.ref, 'refs/tags/')
32-
- name: Export the project version to the job environment and fix it as an ouput of this job
33-
id: setversion
34-
run: |
35-
v=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
36-
echo "BUILD_VERSION=${v}" >> $GITHUB_ENV
37-
echo "::set-output name=version::${v}"
22+
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
3823
- name: Build and Test
39-
run: mvn -B install
40-
- name: Upload snapshot artifact integrations-api-${{ env.BUILD_VERSION }}.jar build on Linux
41-
uses: actions/upload-artifact@v2
24+
id: buildAndTest
25+
run: mvn -B clean install
26+
- uses: actions/upload-artifact@v2
4227
with:
43-
name: integrations-api-${{ env.BUILD_VERSION }}.jar
44-
path: target/integrations-api-*.jar
45-
- name: Build and deploy to jcenter
28+
name: artifacts
29+
path: target/*.jar
30+
- name: Create Release
31+
uses: actions/create-release@v1
4632
if: startsWith(github.ref, 'refs/tags/')
47-
run: mvn -B deploy -DskipTests
4833
env:
49-
BINTRAY_USERNAME: cryptobot
50-
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
34+
GITHUB_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # release as "cryptobot"
35+
with:
36+
tag_name: ${{ github.ref }}
37+
release_name: Release ${{ github.ref }}
38+
prerelease: true
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
name: "CodeQL"
3+
4+
on:
5+
push:
6+
branches: [develop, main]
7+
pull_request:
8+
branches: [develop]
9+
schedule:
10+
- cron: '0 8 * * 0'
11+
12+
jobs:
13+
analyse:
14+
name: Analyse
15+
runs-on: ubuntu-latest
16+
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 2
21+
- uses: actions/setup-java@v1
22+
with:
23+
java-version: 11
24+
- uses: actions/cache@v2
25+
with:
26+
path: ~/.m2/repository
27+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
28+
restore-keys: |
29+
${{ runner.os }}-maven-
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v1
32+
with:
33+
languages: java
34+
- name: Build
35+
run: mvn -B compile
36+
- name: Perform CodeQL Analysis
37+
uses: github/codeql-action/analyze@v1
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to Maven Central
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
tag:
6+
description: 'Tag'
7+
required: true
8+
default: '0.0.0'
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
ref: "refs/tags/${{ github.event.inputs.tag }}"
16+
- uses: actions/setup-java@v1
17+
with:
18+
java-version: 11
19+
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
20+
server-username: MAVEN_USERNAME # env variable for username in deploy
21+
server-password: MAVEN_PASSWORD # env variable for token in deploy
22+
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
23+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
24+
- uses: actions/cache@v2
25+
with:
26+
path: ~/.m2/repository
27+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
28+
restore-keys: |
29+
${{ runner.os }}-maven-
30+
- name: Enforce project version ${{ github.event.inputs.tag }}
31+
run: mvn versions:set -B -DnewVersion=${{ github.event.inputs.tag }}
32+
- name: Deploy
33+
run: mvn deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress
34+
env:
35+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
36+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
37+
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish to GitHub Packages
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-java@v1
12+
with:
13+
java-version: 11
14+
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
15+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
16+
- uses: actions/cache@v2
17+
with:
18+
path: ~/.m2/repository
19+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
20+
restore-keys: |
21+
${{ runner.os }}-maven-
22+
- name: Enforce project version ${{ github.event.release.tag_name }}
23+
run: mvn versions:set -B -DnewVersion=${{ github.event.release.tag_name }}
24+
- name: Deploy
25+
run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
29+
- name: Slack Notification
30+
uses: rtCamp/action-slack-notify@v2
31+
env:
32+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
33+
SLACK_USERNAME: 'Cryptobot'
34+
SLACK_ICON:
35+
SLACK_ICON_EMOJI: ':bot:'
36+
SLACK_CHANNEL: 'cryptomator-desktop'
37+
SLACK_TITLE: "Published ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}"
38+
SLACK_MESSAGE: "Ready to <https://github.com/${{ github.repository }}/actions/workflows/publish-central.yml|deploy to Maven Central>."
39+
SLACK_FOOTER:
40+
MSG_MINIMAL: true

pom.xml

Lines changed: 68 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>org.cryptomator</groupId>
77
<artifactId>integrations-api</artifactId>
8-
<version>0.2.0-SNAPSHOT</version>
8+
<version>1.0.0</version>
99

1010
<name>Cryptomator Integrations API</name>
1111
<description>Defines optional service interfaces that may be used by Cryptomator</description>
@@ -37,27 +37,12 @@
3737
</license>
3838
</licenses>
3939

40-
<repositories>
41-
<repository>
42-
<id>bintray</id>
43-
<name>bintray</name>
44-
<url>https://jcenter.bintray.com</url>
45-
</repository>
46-
</repositories>
47-
48-
<distributionManagement>
49-
<repository>
50-
<id>bintray-jcenter</id>
51-
<url>https://api.bintray.com/maven/cryptomator/maven/integrations-api/;publish=1</url>
52-
</repository>
53-
</distributionManagement>
54-
5540
<build>
5641
<plugins>
5742
<plugin>
5843
<groupId>org.apache.maven.plugins</groupId>
5944
<artifactId>maven-compiler-plugin</artifactId>
60-
<version>3.8.0</version>
45+
<version>3.8.1</version>
6146
<configuration>
6247
<release>11</release>
6348
</configuration>
@@ -117,4 +102,70 @@
117102
</plugin>
118103
</plugins>
119104
</build>
105+
106+
<profiles>
107+
<profile>
108+
<id>sign</id>
109+
<build>
110+
<plugins>
111+
<plugin>
112+
<artifactId>maven-gpg-plugin</artifactId>
113+
<version>1.6</version>
114+
<executions>
115+
<execution>
116+
<id>sign-artifacts</id>
117+
<phase>verify</phase>
118+
<goals>
119+
<goal>sign</goal>
120+
</goals>
121+
<configuration>
122+
<gpgArguments>
123+
<arg>--pinentry-mode</arg>
124+
<arg>loopback</arg>
125+
</gpgArguments>
126+
</configuration>
127+
</execution>
128+
</executions>
129+
</plugin>
130+
</plugins>
131+
</build>
132+
</profile>
133+
134+
<profile>
135+
<id>deploy-central</id>
136+
<distributionManagement>
137+
<repository>
138+
<id>ossrh</id>
139+
<name>Maven Central</name>
140+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
141+
</repository>
142+
</distributionManagement>
143+
<build>
144+
<plugins>
145+
<plugin>
146+
<groupId>org.sonatype.plugins</groupId>
147+
<artifactId>nexus-staging-maven-plugin</artifactId>
148+
<version>1.6.8</version>
149+
<extensions>true</extensions>
150+
<configuration>
151+
<serverId>ossrh</serverId>
152+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
153+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
154+
</configuration>
155+
</plugin>
156+
</plugins>
157+
</build>
158+
</profile>
159+
160+
<profile>
161+
<id>deploy-github</id>
162+
<distributionManagement>
163+
<repository>
164+
<id>github</id>
165+
<name>GitHub Packages</name>
166+
<url>https://maven.pkg.github.com/cryptomator/integrations-api</url>
167+
</repository>
168+
</distributionManagement>
169+
</profile>
170+
</profiles>
120171
</project>

src/main/java/module-info.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module org.cryptomator.integrations.api {
2+
exports org.cryptomator.integrations.autostart;
3+
exports org.cryptomator.integrations.keychain;
4+
exports org.cryptomator.integrations.tray;
5+
exports org.cryptomator.integrations.uiappearance;
6+
}

src/main/java/org/cryptomator/integrations/keychain/KeychainAccessProvider.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
*/
66
public interface KeychainAccessProvider {
77

8+
/**
9+
* A name to display in UI elements. If required, this should be localized.
10+
*
11+
* @return user-friendly name (must not be null or empty)
12+
*/
13+
String displayName();
14+
815
/**
916
* Associates a passphrase with a given key.
1017
*
@@ -45,4 +52,11 @@ public interface KeychainAccessProvider {
4552
*/
4653
boolean isSupported();
4754

55+
/**
56+
* @return <code>true</code> if the keychain to be accessed is locked. Accesing a locked keychain
57+
* requires to unlock the keychain. The keychain backend will show an unlock dialog.
58+
* returning <code>false</code> if the keychain to be accessed is unlocked
59+
*/
60+
boolean isLocked();
61+
4862
}

src/main/java/org/cryptomator/integrations/uiappearance/UiAppearanceProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public interface UiAppearanceProvider {
3232

3333
/**
3434
* Removes a previously registered listener.
35+
* <p>
36+
* If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op.
3537
*
3638
* @param listener The listener
3739
* @throws UiAppearanceException If removing the listener failed.

0 commit comments

Comments
 (0)