Skip to content

Commit 2e6e1db

Browse files
authored
Update release-related configuration (#34)
1 parent 2ee4b26 commit 2e6e1db

File tree

2 files changed

+74
-26
lines changed

2 files changed

+74
-26
lines changed

.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: 16 additions & 26 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-match-processor</artifactId>
106
<version>0.11.0-SNAPSHOT</version>
@@ -152,25 +148,25 @@
152148
<groupId>org.apache.maven.plugins</groupId>
153149
<artifactId>maven-jar-plugin</artifactId>
154150
<version>${maven.jar.version}</version>
155-
<configuration>
156-
<skipIfEmpty>true</skipIfEmpty>
157-
<archive>
158-
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
159-
<manifestEntries>
160-
<Automatic-Module-Name>io.vavr.match.processor</Automatic-Module-Name>
161-
</manifestEntries>
162-
</archive>
163-
</configuration>
164151
</plugin>
165152
<plugin>
166153
<groupId>org.apache.maven.plugins</groupId>
167154
<artifactId>maven-javadoc-plugin</artifactId>
168155
<version>${maven.javadoc.version}</version>
156+
<executions>
157+
<execution>
158+
<id>attach-javadocs</id>
159+
<goals>
160+
<goal>jar</goal>
161+
</goals>
162+
</execution>
163+
</executions>
169164
<configuration>
170-
<!-- fix for https://bugs.openjdk.java.net/browse/JDK-8212233 -->
171-
<source>8</source>
172-
</configuration>
165+
<failOnWarnings>false</failOnWarnings>
166+
<failOnError>true</failOnError>
167+
</configuration>
173168
</plugin>
169+
174170
<plugin>
175171
<groupId>org.apache.felix</groupId>
176172
<artifactId>maven-bundle-plugin</artifactId>
@@ -193,6 +189,7 @@
193189
<configuration>
194190
<publishingServerId>central</publishingServerId>
195191
<centralSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>
192+
<autoPublish>true</autoPublish>
196193
</configuration>
197194
</plugin>
198195
<plugin>
@@ -242,14 +239,7 @@
242239
</build>
243240
<profiles>
244241
<profile>
245-
<id>release-sign-artifacts</id>
246-
<activation>
247-
<property>
248-
<!-- Automatically set to true on mvn release:perform -->
249-
<name>performRelease</name>
250-
<value>true</value>
251-
</property>
252-
</activation>
242+
<id>maven-central-release</id>
253243
<build>
254244
<plugins>
255245
<plugin>

0 commit comments

Comments
 (0)