Skip to content

Commit 68eb836

Browse files
committed
update github actions workflow to use shared workflow maven central release, update pom to use jreleaser
1 parent 9a0234d commit 68eb836

File tree

2 files changed

+32
-87
lines changed

2 files changed

+32
-87
lines changed

.github/workflows/deploy.yml

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -58,41 +58,11 @@ jobs:
5858
uses: actions/[email protected]
5959
with:
6060
path: gbfs-validator-java/target/*.jar
61-
deploy-maven-central:
62-
if: github.repository_owner == 'entur' && github.event_name == 'push' && github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'ci skip')
63-
needs: [maven-package]
64-
runs-on: ubuntu-24.04
65-
steps:
66-
- uses: actions/checkout@v4
67-
with:
68-
fetch-depth: 0
69-
- name: Copy maven settings
70-
run: |
71-
wget https://raw.githubusercontent.com/entur/ror-maven-settings/master/.m2/settings.xml -O .github/workflows/settings.xml
72-
- uses: actions/setup-java@v4
73-
with:
74-
java-version: 17.0.13
75-
distribution: liberica
76-
- name: Cache Maven dependencies
77-
uses: actions/cache@v4
78-
with:
79-
path: ~/.m2/repository
80-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
81-
restore-keys: |
82-
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
83-
${{ runner.os }}-maven-
84-
${{ runner.os }}-
85-
86-
- name: Release to Maven Central
87-
run: |
88-
echo "Start release"
89-
echo $SONATYPE_GPG_KEY_BASE64 | base64 --decode | gpg --batch --no-tty --import --yes
90-
git config user.name github-actions[bot]
91-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
92-
git checkout master
93-
mvn gitflow:release-start gitflow:release-finish \
94-
-DskipTests=true \
95-
-pl gbfs-validator-java \
96-
-Prelease \
97-
-DpostReleaseGoals=deploy \
98-
-DargLine='-Prelease -pl gbfs-validator-java -DskipTests -s .github/workflows/settings.xml' -B -s .github/workflows/settings.xml
61+
publish-release:
62+
if: github.repository_owner == 'entur' && github.event_name == 'push'
63+
name: Publish release to maven central
64+
uses: entur/gha-maven-central/.github/workflows/maven-publish.yml@v1
65+
secrets: inherit
66+
with:
67+
push_to_repo: true
68+
snapshot: false

gbfs-validator-java/pom.xml

Lines changed: 24 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
<slf4j.version>1.7.36</slf4j.version>
5858

5959
<jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>
60-
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
6160
<maven-exec-plugin.version>1.6.0</maven-exec-plugin.version>
6261
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
6362
<maven-enforcer-plugin.version>3.6.1</maven-enforcer-plugin.version>
@@ -77,7 +76,6 @@
7776
<dependency-check-maven.version>5.3.2</dependency-check-maven.version>
7877
<maven-scm-provider-gitexe.version>1.13.0</maven-scm-provider-gitexe.version>
7978
<maven-scm-api.version>1.13.0</maven-scm-api.version>
80-
<gitflow-maven-plugin.version>1.21.0</gitflow-maven-plugin.version>
8179

8280
<!-- empty argLine property, the value is set up by Jacoco during unit tests execution -->
8381
<argLine />
@@ -277,32 +275,6 @@
277275
<version>${dependency-check-maven.version}</version>
278276
</plugin>
279277

280-
<plugin>
281-
<groupId>com.amashchenko.maven.plugin</groupId>
282-
<artifactId>gitflow-maven-plugin</artifactId>
283-
<version>${gitflow-maven-plugin.version}</version>
284-
<configuration>
285-
<allowSnapshots>false</allowSnapshots>
286-
<verbose>true</verbose>
287-
<commitMessagePrefix>[ci skip]</commitMessagePrefix>
288-
<gitFlowConfig>
289-
<developmentBranch>master</developmentBranch>
290-
</gitFlowConfig>
291-
</configuration>
292-
</plugin>
293-
294-
<plugin>
295-
<groupId>org.sonatype.plugins</groupId>
296-
<artifactId>nexus-staging-maven-plugin</artifactId>
297-
<version>${nexus-staging-maven-plugin.version}</version>
298-
<extensions>true</extensions>
299-
<configuration>
300-
<serverId>ossrh</serverId>
301-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
302-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
303-
</configuration>
304-
</plugin>
305-
306278
<plugin>
307279
<groupId>org.apache.maven.plugins</groupId>
308280
<artifactId>maven-source-plugin</artifactId>
@@ -338,36 +310,39 @@
338310

339311
<profiles>
340312
<profile>
341-
<id>release</id>
342-
<activation>
343-
<activeByDefault>false</activeByDefault>
344-
</activation>
345-
<distributionManagement>
346-
<repository>
347-
<id>ossrh</id>
348-
<name>Sonatype release</name>
349-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
350-
</repository>
351-
</distributionManagement>
313+
<id>publication</id>
314+
<properties>
315+
<altDeploymentRepository>local::default::file:./target/staging-deploy</altDeploymentRepository>
316+
</properties>
352317
<build>
318+
<defaultGoal>deploy</defaultGoal>
353319
<plugins>
354320
<plugin>
355321
<groupId>org.apache.maven.plugins</groupId>
356-
<artifactId>maven-gpg-plugin</artifactId>
357-
<version>${maven-gpg-plugin.version}</version>
322+
<artifactId>maven-javadoc-plugin</artifactId>
323+
<executions>
324+
<execution>
325+
<id>attach-javadocs</id>
326+
<goals>
327+
<goal>jar</goal>
328+
</goals>
329+
<configuration>
330+
<attach>true</attach>
331+
</configuration>
332+
</execution>
333+
</executions>
334+
</plugin>
335+
<plugin>
336+
<groupId>org.apache.maven.plugins</groupId>
337+
<artifactId>maven-source-plugin</artifactId>
358338
<executions>
359339
<execution>
360-
<id>sign-artifacts</id>
340+
<id>attach-sources</id>
361341
<goals>
362-
<goal>sign</goal>
342+
<goal>jar</goal>
363343
</goals>
364-
<phase>verify</phase>
365344
<configuration>
366-
<passphrase>${env.SONATYPE_GPG_KEY_PASSWORD}</passphrase>
367-
<gpgArguments>
368-
<arg>--pinentry-mode</arg>
369-
<arg>loopback</arg>
370-
</gpgArguments>
345+
<attach>true</attach>
371346
</configuration>
372347
</execution>
373348
</executions>

0 commit comments

Comments
 (0)