Skip to content

Update release configuration #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}

- name: Deploy Snapshot
run: mvn -B --no-transfer-progress -Psonatype-oss-release -Prelease-sign-artifacts -DskipTests=true deploy
run: mvn -B --no-transfer-progress -Pmaven-central-release -DskipTests=true deploy
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: release
on:
workflow_dispatch:
inputs:
release-tag:
description: 'Tag to release (must start with "v", e.g., v1.2.3)'
required: true

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '21' ]
architecture: [ 'x64' ]

name: Release ${{ github.event.inputs.release-tag }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.release-tag }}

- name: Validate release tag format
run: |
TAG="${{ github.event.inputs.release-tag }}"

if [[ ! "$TAG" =~ ^v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9]+)?$ ]]; then
echo "❌ Invalid tag format: '${{ github.event.inputs.release-tag }}'"
echo "✅ Tag must start with 'v' and follow semantic versioning (e.g., v1.0.0 or v1.2.3-RC1)"
exit 1
fi

if ! git show-ref --tags --verify --quiet "refs/tags/${TAG}"; then
echo "❌ Tag '$TAG' does not exist in the repository"
exit 1
fi

- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
server-id: central
server-username: CENTRAL_USERNAME
server-password: CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}

- name: Release
run: mvn -B --no-transfer-progress -Pmaven-central-release -DskipTests=true deploy
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

129 changes: 23 additions & 106 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<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">
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>9</version>
</parent>
<groupId>io.vavr</groupId>
<artifactId>vavr-test</artifactId>
<version>0.11.0-SNAPSHOT</version>
Expand Down Expand Up @@ -98,8 +94,8 @@
<module>
<moduleInfoSource>
module io.vavr.test {
exports io.vavr.test;
requires io.vavr;
exports io.vavr.test;
requires io.vavr;
}
</moduleInfoSource>
</module>
Expand Down Expand Up @@ -254,24 +250,26 @@
<artifactId>maven-jar-plugin</artifactId>
<version>${maven.jar.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven.deploy.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>prepare-package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<links>
<link>https://docs.oracle.com/javase/8/docs/api/</link>
</links>
<stylesheetfile>${basedir}/../.javadoc/stylesheet.css</stylesheetfile>
<failOnWarnings>false</failOnWarnings>
<failOnError>true</failOnError>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -307,108 +305,27 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<configuration>
<!-- ForkJoinPool parallelism for io.vavr.concurrent.Future.
Typically this is the number of cores by default.
In the travis-ci build env this is currently set to 1. -->
<!--<argLine>-Djava.util.concurrent.ForkJoinPool.common.parallelism=1</argLine>-->
<parallel>all</parallel>
<threadCount>4</threadCount>
<reuseForks>true</reuseForks>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<centralSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sonatype-oss-release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven.source.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>prepare-package</phase>
<goals>
<goal>jar-no-fork</goal>
<goal>test-jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<links>
<link>https://docs.oracle.com/javase/8/docs/api/</link>
</links>
<stylesheetfile>${basedir}/../.javadoc/stylesheet.css</stylesheetfile>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<centralSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<!-- Automatically set to true on mvn release:perform -->
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<id>maven-central-release</id>
<build>
<plugins>
<plugin>
Expand Down