From aa5d46cdb897044acfbdacf6cbae1120a88ac809 Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Sun, 20 Jul 2025 12:48:46 +0200 Subject: [PATCH] Update release configuration --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 58 +++++++++++++++ pom.xml | 129 ++++++---------------------------- 3 files changed, 82 insertions(+), 107 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 976d682..df28dbb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..29d38cf --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} + diff --git a/pom.xml b/pom.xml index 364b3ec..f5f0ebf 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,6 @@ - + 4.0.0 - - org.sonatype.oss - oss-parent - 9 - io.vavr vavr-test 0.11.0-SNAPSHOT @@ -98,8 +94,8 @@ module io.vavr.test { - exports io.vavr.test; - requires io.vavr; + exports io.vavr.test; + requires io.vavr; } @@ -254,6 +250,11 @@ maven-jar-plugin ${maven.jar.version} + + org.apache.maven.plugins + maven-deploy-plugin + ${maven.deploy.version} + org.apache.maven.plugins maven-javadoc-plugin @@ -261,17 +262,14 @@ attach-javadocs - prepare-package jar - - https://docs.oracle.com/javase/8/docs/api/ - - ${basedir}/../.javadoc/stylesheet.css + false + true @@ -307,108 +305,27 @@ maven-surefire-plugin ${maven.surefire.version} - - all 4 true + + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 + true + + central + https://central.sonatype.com/repository/maven-snapshots/ + true + + - sonatype-oss-release - - - - org.apache.maven.plugins - maven-source-plugin - ${maven.source.version} - - - attach-sources - prepare-package - - jar-no-fork - test-jar-no-fork - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.11.2 - - - attach-javadocs - - jar - - - - - - https://docs.oracle.com/javase/8/docs/api/ - - ${basedir}/../.javadoc/stylesheet.css - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.2.8 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - - - - - org.sonatype.central - central-publishing-maven-plugin - 0.8.0 - true - - central - https://central.sonatype.com/repository/maven-snapshots/ - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - - - - - release-sign-artifacts - - - - performRelease - true - - + maven-central-release