Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Oct 19, 2021
2 parents fee3a18 + c37beec commit 952c5fa
Show file tree
Hide file tree
Showing 44 changed files with 278 additions and 63 deletions.
8 changes: 8 additions & 0 deletions .crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commit_message: '[ci skip]'
files:
- source: /src/main/resources/MacIntegrationsBundle.properties
translation: /src/main/resources/MacIntegrationsBundle_%two_letters_code%.properties
escape_quotes: 0
escape_special_characters: 0
skip_untranslated_files: true
skip_untranslated_strings: true
41 changes: 15 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,40 @@
name: Build

on:
[push]

jobs:
build:
name: Build and Test
runs-on: macos-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
env:
BUILD_VERSION: SNAPSHOT
outputs:
artifact-version: ${{ steps.setversion.outputs.version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11
server-id: bintray-jcenter
server-username: BINTRAY_USERNAME
server-password: BINTRAY_API_KEY
- uses: actions/cache@v1
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Ensure to use tagged version
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
if: startsWith(github.ref, 'refs/tags/')
- name: Export the project version to the job environment and fix it as an ouput of this job
id: setversion
run: |
v=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
echo "BUILD_VERSION=${v}" >> $GITHUB_ENV
echo "::set-output name=version::${v}"
shell: bash
run: |
mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
- name: Build and Test
run: mvn -B install
- name: Upload .jars
uses: actions/upload-artifact@v2
id: buildAndTest
run: mvn -B clean install
- uses: actions/upload-artifact@v2
with:
name: integrations-mac-${{ env.BUILD_VERSION }}
path: target/integrations-mac-*.jar
- name: Build and deploy to jcenter
name: artifacts
path: target/*.jar
- name: Create Release
uses: actions/create-release@v1
if: startsWith(github.ref, 'refs/tags/')
run: mvn -B deploy -DskipTests
env:
BINTRAY_USERNAME: cryptobot
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
GITHUB_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # release as "cryptobot"
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
prerelease: true
37 changes: 37 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

name: "CodeQL"

on:
push:
branches: [develop, main]
pull_request:
branches: [develop]
schedule:
- cron: '0 8 * * 0'

jobs:
analyse:
name: Analyse
runs-on: macos-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: java
- name: Build
run: mvn -B compile
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
37 changes: 37 additions & 0 deletions .github/workflows/publish-central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to Maven Central
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag'
required: true
default: '0.0.0'
jobs:
publish:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
ref: "refs/tags/${{ github.event.inputs.tag }}"
- uses: actions/setup-java@v1
with:
java-version: 11
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_PASSWORD # env variable for token in deploy
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Enforce project version ${{ github.event.inputs.tag }}
run: mvn versions:set -B -DnewVersion=${{ github.event.inputs.tag }}
- name: Deploy
run: mvn deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
28 changes: 28 additions & 0 deletions .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish to GitHub Packages
on:
release:
types: [published]
jobs:
publish:
runs-on: macos-latest
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Enforce project version ${{ github.event.release.tag_name }}
run: mvn versions:set -B -DnewVersion=${{ github.event.release.tag_name }}
- name: Deploy
run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
109 changes: 80 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cryptomator</groupId>
<artifactId>integrations-mac</artifactId>
<version>0.1.0</version>
<version>1.0.0</version>

<name>Cryptomator Integrations for macOS</name>
<description>Provides optional macOS services used by Cryptomator</description>
Expand All @@ -29,14 +29,14 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- runtime dependencies -->
<api.version>0.1.6</api.version>
<slf4j.version>1.7.30</slf4j.version>
<guava.version>30.0-jre</guava.version>
<gson.version>2.8.6</gson.version>
<api.version>1.0.0</api.version>
<slf4j.version>1.7.32</slf4j.version>
<guava.version>31.0-jre</guava.version>
<gson.version>2.8.8</gson.version>

<!-- test dependencies -->
<junit.jupiter.version>5.6.2</junit.jupiter.version>
<mockito.version>3.3.3</mockito.version>
<junit.jupiter.version>5.8.1</junit.jupiter.version>
<mockito.version>3.12.4</mockito.version>
</properties>

<licenses>
Expand All @@ -47,21 +47,6 @@
</license>
</licenses>

<repositories>
<repository>
<id>bintray</id>
<name>bintray</name>
<url>https://jcenter.bintray.com</url>
</repository>
</repositories>

<distributionManagement>
<repository>
<id>bintray-jcenter</id>
<url>https://api.bintray.com/maven/cryptomator/maven/integrations-mac/;publish=1</url>
</repository>
</distributionManagement>

<dependencies>
<dependency>
<groupId>org.cryptomator</groupId>
Expand Down Expand Up @@ -126,7 +111,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
<configuration>
<compilerArgs>
<arg>-h</arg>
Expand All @@ -138,7 +123,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<version>3.0.0</version>
<executions>
<execution>
<id>check-preconditions</id>
Expand Down Expand Up @@ -167,7 +152,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<version>3.0.0</version>
<executions>
<execution>
<goals>
Expand All @@ -189,7 +174,7 @@
<argument>-quiet</argument>
<argument>clean</argument>
<argument>archive</argument>
<argument>USER_HEADER_SEARCH_PATHS="${project.basedir}/src/main/headers/ ${java.home}/include/**"</argument>
<argument>JAVA_HOME="${java.home}"</argument>
</arguments>
</configuration>
</execution>
Expand Down Expand Up @@ -221,11 +206,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.0.0-M5</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -237,7 +222,7 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down Expand Up @@ -292,4 +277,70 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>sign</id>
<build>
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>deploy-central</id>
<distributionManagement>
<repository>
<id>ossrh</id>
<name>Maven Central</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>deploy-github</id>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/cryptomator/integrations-mac</url>
</repository>
</distributionManagement>
</profile>
</profiles>
</project>
14 changes: 14 additions & 0 deletions src/main/java/org/cryptomator/macos/common/Localization.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.cryptomator.macos.common;

import java.util.ResourceBundle;

public enum Localization {
INSTANCE;

private final ResourceBundle resourceBundle = ResourceBundle.getBundle("MacIntegrationsBundle");

public static ResourceBundle get() {
return INSTANCE.resourceBundle;
}

}
Loading

0 comments on commit 952c5fa

Please sign in to comment.