Skip to content

Commit 7d4c476

Browse files
committed
Merge branch 'develop' into release/2.9.0
2 parents 43da42b + 6f2447c commit 7d4c476

File tree

3 files changed

+19
-50
lines changed

3 files changed

+19
-50
lines changed

.github/workflows/publish-central.yml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,28 @@
11
name: Publish to Maven Central
22
on:
3-
workflow_dispatch:
4-
inputs:
5-
tag:
6-
description: 'Tag'
7-
required: true
8-
default: '0.0.0'
3+
release:
4+
types: [published]
95
jobs:
106
publish:
117
runs-on: ubuntu-latest
8+
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
129
steps:
1310
- uses: actions/checkout@v4
14-
with:
15-
ref: "refs/tags/${{ github.event.inputs.tag }}"
16-
show-progress: false
1711
- uses: actions/setup-java@v4
1812
with:
1913
java-version: 21
2014
distribution: 'temurin'
2115
cache: 'maven'
22-
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
23-
server-username: MAVEN_USERNAME # env variable for username in deploy
24-
server-password: MAVEN_PASSWORD # env variable for token in deploy
25-
- name: Enforce project version ${{ github.event.inputs.tag }}
26-
run: mvn versions:set -B -DnewVersion=${{ github.event.inputs.tag }}
16+
server-id: central
17+
server-username: MAVEN_CENTRAL_USERNAME
18+
server-password: MAVEN_CENTRAL_PASSWORD
19+
- name: Enforce project version ${{ github.event.release.tag_name }}
20+
run: mvn versions:set -B -DnewVersion=${{ github.event.release.tag_name }}
2721
- name: Deploy
2822
run: mvn deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress
2923
env:
30-
MAVEN_OPTS: >
31-
--add-opens=java.base/java.util=ALL-UNNAMED
32-
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
33-
--add-opens=java.base/java.text=ALL-UNNAMED
34-
--add-opens=java.desktop/java.awt.font=ALL-UNNAMED
35-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
36-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
24+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
25+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
3726
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
38-
MAVEN_GPG_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
27+
MAVEN_GPG_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
3928
MAVEN_GPG_KEY_FINGERPRINT: ${{ vars.RELEASES_GPG_KEY_FINGERPRINT }}

.github/workflows/publish-github.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,5 @@ jobs:
2222
env:
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2424
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
25-
MAVEN_GPG_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
25+
MAVEN_GPG_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
2626
MAVEN_GPG_KEY_FINGERPRINT: ${{ vars.RELEASES_GPG_KEY_FINGERPRINT }}
27-
- name: Slack Notification
28-
uses: rtCamp/action-slack-notify@v2
29-
env:
30-
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
31-
SLACK_USERNAME: 'Cryptobot'
32-
SLACK_ICON:
33-
SLACK_ICON_EMOJI: ':bot:'
34-
SLACK_CHANNEL: 'cryptomator-desktop'
35-
SLACK_TITLE: "Published ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}"
36-
SLACK_MESSAGE: "Ready to <https://github.com/${{ github.repository }}/actions/workflows/publish-central.yml|deploy to Maven Central>."
37-
SLACK_FOOTER:
38-
MSG_MINIMAL: true

pom.xml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<scm>
1111
<connection>scm:git:git@github.com:cryptomator/cryptofs.git</connection>
1212
<developerConnection>scm:git:git@github.com:cryptomator/cryptofs.git</developerConnection>
13-
<url>git@github.com:cryptomator/cryptofs.git</url>
13+
<url>https://github.com/cryptomator/cryptofs</url>
1414
</scm>
1515

1616
<properties>
@@ -44,7 +44,7 @@
4444
<dependency-check.version>12.1.0</dependency-check.version>
4545
<junit-tree-reporter.version>1.4.0</junit-tree-reporter.version>
4646
<jacoco.version>0.8.12</jacoco.version>
47-
<nexus-staging.version>1.7.0</nexus-staging.version>
47+
<central-publishing.version>0.7.0</central-publishing.version>
4848

4949
<!-- Property used by surefire to determine jacoco engine -->
5050
<surefire.jacoco.args></surefire.jacoco.args>
@@ -372,24 +372,16 @@
372372

373373
<profile>
374374
<id>deploy-central</id>
375-
<distributionManagement>
376-
<repository>
377-
<id>ossrh</id>
378-
<name>Maven Central</name>
379-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
380-
</repository>
381-
</distributionManagement>
382375
<build>
383376
<plugins>
384377
<plugin>
385-
<groupId>org.sonatype.plugins</groupId>
386-
<artifactId>nexus-staging-maven-plugin</artifactId>
387-
<version>${nexus-staging.version}</version>
378+
<groupId>org.sonatype.central</groupId>
379+
<artifactId>central-publishing-maven-plugin</artifactId>
380+
<version>${central-publishing.version}</version>
388381
<extensions>true</extensions>
389382
<configuration>
390-
<serverId>ossrh</serverId>
391-
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
392-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
383+
<publishingServerId>central</publishingServerId>
384+
<autoPublish>true</autoPublish>
393385
</configuration>
394386
</plugin>
395387
</plugins>

0 commit comments

Comments
 (0)