Skip to content

Commit bcc34aa

Browse files
committed
Merge branch 'develop' into release/1.0.0
2 parents 861995c + 7c34294 commit bcc34aa

File tree

5 files changed

+196
-26
lines changed

5 files changed

+196
-26
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,40 @@
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}"
3822
shell: bash
23+
run: |
24+
mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
3925
- name: Build and Test
40-
run: mvn -B install
41-
- name: Upload .jars
42-
uses: actions/upload-artifact@v2
26+
id: buildAndTest
27+
run: mvn -B clean install
28+
- uses: actions/upload-artifact@v2
4329
with:
44-
name: integrations-linux-${{ env.BUILD_VERSION }}
45-
path: target/integrations-linux-*.jar
46-
- name: Build and deploy to jcenter
30+
name: artifacts
31+
path: target/*.jar
32+
- name: Create Release
33+
uses: actions/create-release@v1
4734
if: startsWith(github.ref, 'refs/tags/')
48-
run: mvn -B deploy -DskipTests
4935
env:
50-
BINTRAY_USERNAME: cryptobot
51-
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
36+
GITHUB_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # release as "cryptobot"
37+
with:
38+
tag_name: ${{ github.ref }}
39+
release_name: Release ${{ github.ref }}
40+
prerelease: true

.github/workflows/codeql-analysis.yml

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

.github/workflows/publish-central.yml

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 }}

.github/workflows/publish-github.yml

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: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,71 @@
187187
</plugin>
188188
</plugins>
189189
</build>
190+
191+
192+
<profiles>
193+
<profile>
194+
<id>sign</id>
195+
<build>
196+
<plugins>
197+
<plugin>
198+
<artifactId>maven-gpg-plugin</artifactId>
199+
<version>1.6</version>
200+
<executions>
201+
<execution>
202+
<id>sign-artifacts</id>
203+
<phase>verify</phase>
204+
<goals>
205+
<goal>sign</goal>
206+
</goals>
207+
<configuration>
208+
<gpgArguments>
209+
<arg>--pinentry-mode</arg>
210+
<arg>loopback</arg>
211+
</gpgArguments>
212+
</configuration>
213+
</execution>
214+
</executions>
215+
</plugin>
216+
</plugins>
217+
</build>
218+
</profile>
219+
220+
<profile>
221+
<id>deploy-central</id>
222+
<distributionManagement>
223+
<repository>
224+
<id>ossrh</id>
225+
<name>Maven Central</name>
226+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
227+
</repository>
228+
</distributionManagement>
229+
<build>
230+
<plugins>
231+
<plugin>
232+
<groupId>org.sonatype.plugins</groupId>
233+
<artifactId>nexus-staging-maven-plugin</artifactId>
234+
<version>1.6.8</version>
235+
<extensions>true</extensions>
236+
<configuration>
237+
<serverId>ossrh</serverId>
238+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
239+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
240+
</configuration>
241+
</plugin>
242+
</plugins>
243+
</build>
244+
</profile>
245+
246+
<profile>
247+
<id>deploy-github</id>
248+
<distributionManagement>
249+
<repository>
250+
<id>github</id>
251+
<name>GitHub Packages</name>
252+
<url>https://maven.pkg.github.com/cryptomator/integrations-linux</url>
253+
</repository>
254+
</distributionManagement>
255+
</profile>
256+
</profiles>
190257
</project>

0 commit comments

Comments
 (0)