Skip to content

Commit 8b9905f

Browse files
authored
[CC-1936] Update release workflow (#177)
1 parent 8fb01fe commit 8b9905f

3 files changed

Lines changed: 15 additions & 63 deletions

File tree

.github/workflows/manual_publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ jobs:
1313
java-version: '17'
1414
distribution: 'temurin'
1515
cache: maven
16-
server-id: ossrh
16+
server-id: central
1717
server-username: MAVEN_USERNAME
1818
server-password: MAVEN_PASSWORD
1919
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
2020
gpg-passphrase: GPG_PASSPHRASE
2121
- name: Publish package
2222
run: mvn --batch-mode -DskipTests=true deploy
2323
env:
24-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
25-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
24+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_PUBLISH_USER }}
25+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PUBLISH_TOKEN }}
2626
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.github/workflows/release.yml

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,57 +14,14 @@ jobs:
1414
java-version: '17'
1515
distribution: 'temurin'
1616
cache: maven
17-
server-id: ossrh
17+
server-id: central
1818
server-username: MAVEN_USERNAME
1919
server-password: MAVEN_PASSWORD
2020
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
2121
gpg-passphrase: GPG_PASSPHRASE
2222
- name: Publish package
2323
run: mvn --batch-mode -DskipTests=true deploy
2424
env:
25-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
26-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
25+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_PUBLISH_USER }}
26+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PUBLISH_TOKEN }}
2727
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
28-
29-
send-email:
30-
name: Send release Email
31-
runs-on: ubuntu-latest
32-
steps:
33-
- name: Checkout
34-
uses: actions/checkout@v4
35-
- name: Decode configuration
36-
env:
37-
CONFIG: ${{ secrets.RELEASE_AUTOMATOR_BASE64_CONFIG }}
38-
run: |
39-
echo $CONFIG | base64 --decode > release.yaml
40-
- name: Run release-automator
41-
uses: unzerdev/unzer-tech-toolbox/.github/actions/release-changelog@main
42-
with:
43-
command: mail
44-
version: ${{github.ref_name}}
45-
46-
generate-tweet:
47-
name: Generate tweet
48-
runs-on: ubuntu-latest
49-
steps:
50-
- name: Checkout
51-
uses: actions/checkout@v4
52-
- name: Decode configuration
53-
env:
54-
CONFIG: ${{ secrets.RELEASE_AUTOMATOR_BASE64_CONFIG }}
55-
run: |
56-
echo $CONFIG | base64 --decode > release.yaml
57-
- name: Run release-automator
58-
uses: unzerdev/unzer-tech-toolbox/.github/actions/release-changelog@main
59-
with:
60-
command: tweet
61-
version: ${{github.ref_name}}
62-
- name: Copy out tweet file
63-
run: |
64-
sudo cp target/tweet.txt tweet.txt
65-
- name: Attach release notes
66-
uses: actions/upload-artifact@v3
67-
with:
68-
name: tweet
69-
path: tweet.txt
70-
retention-days: 5

pom.xml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,6 @@
4747
<system-stubs.version>2.0.1</system-stubs.version>
4848
</properties>
4949

50-
<distributionManagement>
51-
<snapshotRepository>
52-
<id>ossrh</id>
53-
<name>Snapshot Repository OSSRH</name>
54-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
55-
</snapshotRepository>
56-
<repository>
57-
<id>ossrh</id>
58-
<name>Central Repository OSSRH</name>
59-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
60-
</repository>
61-
</distributionManagement>
62-
6350
<reporting>
6451
<plugins>
6552
<plugin>
@@ -165,7 +152,6 @@
165152
</execution>
166153
</executions>
167154
</plugin>
168-
169155
<plugin>
170156
<groupId>org.apache.maven.plugins</groupId>
171157
<artifactId>maven-gpg-plugin</artifactId>
@@ -204,6 +190,15 @@
204190
</execution>
205191
</executions>
206192
</plugin>
193+
<plugin>
194+
<groupId>org.sonatype.central</groupId>
195+
<artifactId>central-publishing-maven-plugin</artifactId>
196+
<version>0.8.0</version>
197+
<extensions>true</extensions>
198+
<configuration>
199+
<publishingServerId>central</publishingServerId>
200+
</configuration>
201+
</plugin>
207202
</plugins>
208203
</build>
209204

0 commit comments

Comments
 (0)