Skip to content

Commit 0d9aa34

Browse files
authored
Update release configuration (#47)
1 parent 6e1582a commit 0d9aa34

File tree

3 files changed

+82
-107
lines changed

3 files changed

+82
-107
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
5252

5353
- name: Deploy Snapshot
54-
run: mvn -B --no-transfer-progress -Psonatype-oss-release -Prelease-sign-artifacts -DskipTests=true deploy
54+
run: mvn -B --no-transfer-progress -Pmaven-central-release -DskipTests=true deploy
5555
env:
5656
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
5757
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
release-tag:
6+
description: 'Tag to release (must start with "v", e.g., v1.2.3)'
7+
required: true
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
java: [ '21' ]
18+
architecture: [ 'x64' ]
19+
20+
name: Release ${{ github.event.inputs.release-tag }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
ref: ${{ github.event.inputs.release-tag }}
25+
26+
- name: Validate release tag format
27+
run: |
28+
TAG="${{ github.event.inputs.release-tag }}"
29+
30+
if [[ ! "$TAG" =~ ^v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9]+)?$ ]]; then
31+
echo "❌ Invalid tag format: '${{ github.event.inputs.release-tag }}'"
32+
echo "✅ Tag must start with 'v' and follow semantic versioning (e.g., v1.0.0 or v1.2.3-RC1)"
33+
exit 1
34+
fi
35+
36+
if ! git show-ref --tags --verify --quiet "refs/tags/${TAG}"; then
37+
echo "❌ Tag '$TAG' does not exist in the repository"
38+
exit 1
39+
fi
40+
41+
- name: Setup JDK
42+
uses: actions/setup-java@v4
43+
with:
44+
distribution: 'temurin'
45+
java-version: '21'
46+
cache: 'maven'
47+
server-id: central
48+
server-username: CENTRAL_USERNAME
49+
server-password: CENTRAL_PASSWORD
50+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
51+
52+
- name: Release
53+
run: mvn -B --no-transfer-progress -Pmaven-central-release -DskipTests=true deploy
54+
env:
55+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
56+
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
57+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
58+

pom.xml

Lines changed: 23 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
23
<modelVersion>4.0.0</modelVersion>
3-
<parent>
4-
<groupId>org.sonatype.oss</groupId>
5-
<artifactId>oss-parent</artifactId>
6-
<version>9</version>
7-
</parent>
84
<groupId>io.vavr</groupId>
95
<artifactId>vavr-test</artifactId>
106
<version>0.11.0-SNAPSHOT</version>
@@ -98,8 +94,8 @@
9894
<module>
9995
<moduleInfoSource>
10096
module io.vavr.test {
101-
exports io.vavr.test;
102-
requires io.vavr;
97+
exports io.vavr.test;
98+
requires io.vavr;
10399
}
104100
</moduleInfoSource>
105101
</module>
@@ -254,24 +250,26 @@
254250
<artifactId>maven-jar-plugin</artifactId>
255251
<version>${maven.jar.version}</version>
256252
</plugin>
253+
<plugin>
254+
<groupId>org.apache.maven.plugins</groupId>
255+
<artifactId>maven-deploy-plugin</artifactId>
256+
<version>${maven.deploy.version}</version>
257+
</plugin>
257258
<plugin>
258259
<groupId>org.apache.maven.plugins</groupId>
259260
<artifactId>maven-javadoc-plugin</artifactId>
260261
<version>${maven.javadoc.version}</version>
261262
<executions>
262263
<execution>
263264
<id>attach-javadocs</id>
264-
<phase>prepare-package</phase>
265265
<goals>
266266
<goal>jar</goal>
267267
</goals>
268268
</execution>
269269
</executions>
270270
<configuration>
271-
<links>
272-
<link>https://docs.oracle.com/javase/8/docs/api/</link>
273-
</links>
274-
<stylesheetfile>${basedir}/../.javadoc/stylesheet.css</stylesheetfile>
271+
<failOnWarnings>false</failOnWarnings>
272+
<failOnError>true</failOnError>
275273
</configuration>
276274
</plugin>
277275
<plugin>
@@ -307,108 +305,27 @@
307305
<artifactId>maven-surefire-plugin</artifactId>
308306
<version>${maven.surefire.version}</version>
309307
<configuration>
310-
<!-- ForkJoinPool parallelism for io.vavr.concurrent.Future.
311-
Typically this is the number of cores by default.
312-
In the travis-ci build env this is currently set to 1. -->
313-
<!--<argLine>-Djava.util.concurrent.ForkJoinPool.common.parallelism=1</argLine>-->
314308
<parallel>all</parallel>
315309
<threadCount>4</threadCount>
316310
<reuseForks>true</reuseForks>
317311
</configuration>
318312
</plugin>
313+
<plugin>
314+
<groupId>org.sonatype.central</groupId>
315+
<artifactId>central-publishing-maven-plugin</artifactId>
316+
<version>0.8.0</version>
317+
<extensions>true</extensions>
318+
<configuration>
319+
<publishingServerId>central</publishingServerId>
320+
<centralSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>
321+
<autoPublish>true</autoPublish>
322+
</configuration>
323+
</plugin>
319324
</plugins>
320325
</build>
321326
<profiles>
322327
<profile>
323-
<id>sonatype-oss-release</id>
324-
<build>
325-
<plugins>
326-
<plugin>
327-
<groupId>org.apache.maven.plugins</groupId>
328-
<artifactId>maven-source-plugin</artifactId>
329-
<version>${maven.source.version}</version>
330-
<executions>
331-
<execution>
332-
<id>attach-sources</id>
333-
<phase>prepare-package</phase>
334-
<goals>
335-
<goal>jar-no-fork</goal>
336-
<goal>test-jar-no-fork</goal>
337-
</goals>
338-
</execution>
339-
</executions>
340-
</plugin>
341-
<plugin>
342-
<groupId>org.apache.maven.plugins</groupId>
343-
<artifactId>maven-javadoc-plugin</artifactId>
344-
<version>3.11.2</version>
345-
<executions>
346-
<execution>
347-
<id>attach-javadocs</id>
348-
<goals>
349-
<goal>jar</goal>
350-
</goals>
351-
</execution>
352-
</executions>
353-
<configuration>
354-
<links>
355-
<link>https://docs.oracle.com/javase/8/docs/api/</link>
356-
</links>
357-
<stylesheetfile>${basedir}/../.javadoc/stylesheet.css</stylesheetfile>
358-
</configuration>
359-
</plugin>
360-
<plugin>
361-
<groupId>org.apache.maven.plugins</groupId>
362-
<artifactId>maven-gpg-plugin</artifactId>
363-
<version>3.2.8</version>
364-
<executions>
365-
<execution>
366-
<id>sign-artifacts</id>
367-
<phase>verify</phase>
368-
<goals>
369-
<goal>sign</goal>
370-
</goals>
371-
<configuration>
372-
<gpgArguments>
373-
<arg>--pinentry-mode</arg>
374-
<arg>loopback</arg>
375-
</gpgArguments>
376-
</configuration>
377-
</execution>
378-
</executions>
379-
</plugin>
380-
381-
<plugin>
382-
<groupId>org.sonatype.central</groupId>
383-
<artifactId>central-publishing-maven-plugin</artifactId>
384-
<version>0.8.0</version>
385-
<extensions>true</extensions>
386-
<configuration>
387-
<publishingServerId>central</publishingServerId>
388-
<centralSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>
389-
</configuration>
390-
</plugin>
391-
392-
<plugin>
393-
<groupId>org.apache.maven.plugins</groupId>
394-
<artifactId>maven-deploy-plugin</artifactId>
395-
<configuration>
396-
<skip>true</skip>
397-
</configuration>
398-
</plugin>
399-
</plugins>
400-
</build>
401-
</profile>
402-
403-
<profile>
404-
<id>release-sign-artifacts</id>
405-
<activation>
406-
<property>
407-
<!-- Automatically set to true on mvn release:perform -->
408-
<name>performRelease</name>
409-
<value>true</value>
410-
</property>
411-
</activation>
328+
<id>maven-central-release</id>
412329
<build>
413330
<plugins>
414331
<plugin>

0 commit comments

Comments
 (0)