From 9fd0f8fdff8c0e57d1611ed9686f2afe956fe1d7 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Tue, 2 Aug 2022 17:56:55 +0200 Subject: [PATCH 1/2] #36 Fix maven central deployment --- .github/workflows/createReleasePom.sh | 19 +++++++++++++++++++ ...release_droid_release_on_maven_central.yml | 10 ++++++++-- .gitignore | 3 ++- README.md | 4 +++- 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100755 .github/workflows/createReleasePom.sh diff --git a/.github/workflows/createReleasePom.sh b/.github/workflows/createReleasePom.sh new file mode 100755 index 0000000..84c1b46 --- /dev/null +++ b/.github/workflows/createReleasePom.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +if ! command -v xmlstarlet &> /dev/null +then + echo "xmlstarlet tool is not available, please install it to continue." + exit 1 +fi + +readonly RELEASE_POM=release-pom.xml +echo "Copying original POM file to $RELEASE_POM" +cp pom.xml "$RELEASE_POM" + +CURRENT_VERSION=$(mvn --file "$RELEASE_POM" -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec) + +echo "Updating artifactId value for release POM $RELEASE_POM" +xmlstarlet edit -L --ps -N pom="http://maven.apache.org/POM/4.0.0" \ + --update "/pom:project/pom:artifactId" \ + --value "import-export-udf-common-scala_\${scala.compat.version}" "$RELEASE_POM" + diff --git a/.github/workflows/release_droid_release_on_maven_central.yml b/.github/workflows/release_droid_release_on_maven_central.yml index 7028ba7..da8b1f6 100644 --- a/.github/workflows/release_droid_release_on_maven_central.yml +++ b/.github/workflows/release_droid_release_on_maven_central.yml @@ -29,13 +29,19 @@ jobs: server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Install xmlstarlet + run: sudo apt install -y --no-install-recommends xmlstarlet + - name: Update release pom file + run: ./.github/workflows/createReleasePom.sh - name: Publish to Central Repository for ${{ matrix.scala-version }} run: | - mvn clean deploy \ + mvn --file release-pom.xml clean deploy \ -P${{ matrix.scala-version }} \ -Dgpg.skip=false \ -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \ -DskipTests env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} \ No newline at end of file + MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + - name: Remove release pom file + run: rm -rf release-pom.xml \ No newline at end of file diff --git a/.gitignore b/.gitignore index 46b8a44..25b035d 100644 --- a/.gitignore +++ b/.gitignore @@ -71,4 +71,5 @@ tmp Desktop.ini Thumbs.db -*.flattened-pom.xml \ No newline at end of file +*.flattened-pom.xml +release-pom.xml diff --git a/README.md b/README.md index 0a299d0..fda58fb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # Import Export UDF Common Scala [![Build Status](https://github.com/exasol/import-export-udf-common-scala/actions/workflows/ci-build.yml/badge.svg)](https://github.com/exasol/import-export-udf-common-scala/actions/workflows/ci-build.yml) -[![Maven Central](https://img.shields.io/maven-central/v/com.exasol/import-export-udf-common-scala)](https://search.maven.org/artifact/com.exasol/import-export-udf-common-scala_2.13) + +Scala 2.13: [![Maven Central](https://img.shields.io/maven-central/v/com.exasol/import-export-udf-common-scala_2.13)](https://search.maven.org/artifact/com.exasol/import-export-udf-common-scala_2.13) +Scala 2.12: [![Maven Central](https://img.shields.io/maven-central/v/com.exasol/import-export-udf-common-scala_2.12)](https://search.maven.org/artifact/com.exasol/import-export-udf-common-scala_2.12) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aimport-export-udf-common-scala&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.exasol%3Aimport-export-udf-common-scala) From 59091eead0b0c8842712c9caa5f3005ef7f49aa6 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Tue, 2 Aug 2022 18:00:55 +0200 Subject: [PATCH 2/2] Update changelog --- doc/changes/changelog.md | 1 + doc/changes/changes_0.4.2.md | 19 +++++++++++++++++++ pk_generated_parent.pom | 2 +- pom.xml | 6 +++--- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 doc/changes/changes_0.4.2.md diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index a542f88..1b70e29 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.4.2](changes_0.4.2.md) * [0.4.1](changes_0.4.1.md) * [0.4.0](changes_0.4.0.md) * [0.3.1](changes_0.3.1.md) diff --git a/doc/changes/changes_0.4.2.md b/doc/changes/changes_0.4.2.md new file mode 100644 index 0000000..8485771 --- /dev/null +++ b/doc/changes/changes_0.4.2.md @@ -0,0 +1,19 @@ +# Import Export UDF Common Scala 0.4.2, released 2022-08-03 + +Code name: Fixed Maven Central deployment + +## Summary + +The automatic Maven Central deployment tried to upload both variants for Scala 2.12 and 2.13 to the same artifact https://repo1.maven.org/maven2/com/exasol/import-export-udf-common-scala/ which causes the build to fail. + +Now they are uploaded with the correct artifact ids: + +* https://repo1.maven.org/maven2/com/exasol/import-export-udf-common-scala_2.12/ +* https://repo1.maven.org/maven2/com/exasol/import-export-udf-common-scala_2.13/ + + +## Bugfix + +* #36: Fixed Maven Central deployment + +## Dependency Updates diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index bcf7402..6b2214d 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol import-export-udf-common-scala-generated-parent - 0.4.1 + 0.4.2 pom UTF-8 diff --git a/pom.xml b/pom.xml index 9203c2e..ae77b9a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.exasol import-export-udf-common-scala - 0.4.1 + 0.4.2 Import Export UDF Common Scala Common import export libraries used in Exasol user defined functions https://github.com/exasol/import-export-udf-common-scala/ @@ -398,7 +398,7 @@ import-export-udf-common-scala-generated-parent com.exasol - 0.4.1 + 0.4.2 pk_generated_parent.pom - \ No newline at end of file +