This is an automated email from the ASF dual-hosted git repository.
xianjingfeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/master by this push:
new 1e31dd744 [#1275] chore: add scripts for publishing maven releases
(#1281)
1e31dd744 is described below
commit 1e31dd74424b610e697487d78598a7375f889506
Author: xianjingfeng <[email protected]>
AuthorDate: Tue Oct 31 14:15:38 2023 +0800
[#1275] chore: add scripts for publishing maven releases (#1281)
### What changes were proposed in this pull request?
add scripts for publishing maven releases
### Why are the changes needed?
Fix: #1275
### Does this PR introduce any user-facing change?
No.
### How was this patch tested?
CI
---
pom.xml | 121 +++++++++++++++++++++++++++++++++++++
release/asf-settings.xml | 34 +++++++++++
release/publish_maven_artifacts.sh | 48 +++++++++++++++
3 files changed, 203 insertions(+)
diff --git a/pom.xml b/pom.xml
index 82651c8e8..efbc46e88 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,7 +34,26 @@
<version>18</version>
</parent>
+ <distributionManagement>
+ <repository>
+ <id>apache.releases.https</id>
+ <name>${distMgmtReleasesName}</name>
+ <url>${distMgmtReleasesUrl}</url>
+ </repository>
+ <snapshotRepository>
+ <id>apache.snapshots.https</id>
+ <name>${distMgmtSnapshotsName}</name>
+ <url>${distMgmtSnapshotsUrl}</url>
+ </snapshotRepository>
+ </distributionManagement>
+
<properties>
+ <distMgmtReleasesName>Apache Release Distribution
Repository</distMgmtReleasesName>
+
<distMgmtReleasesUrl>https://repository.apache.org/service/local/staging/deploy/maven2</distMgmtReleasesUrl>
+ <distMgmtSnapshotsName>Apache Development Snapshot
Repository</distMgmtSnapshotsName>
+
<distMgmtSnapshotsUrl>https://repository.apache.org/content/repositories/snapshots</distMgmtSnapshotsUrl>
+ <version.apache-resource-bundles>1.5</version.apache-resource-bundles>
+ <version.checksum-maven-plugin>1.11</version.checksum-maven-plugin>
<awaitility.version>4.2.0</awaitility.version>
<checkstyle.version>9.3</checkstyle.version>
<commons-logging.version>1.2</commons-logging.version>
@@ -2173,5 +2192,107 @@
</dependency>
</dependencies>
</profile>
+ <profile>
+ <id>apache-release</id>
+ <build>
+ <plugins>
+ <!-- Create a source-release artifact that contains the fully
buildable
+ project directory source structure. This is the artifact which
is
+ the official subject of any release vote. -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.apache.resources</groupId>
+
<artifactId>apache-source-release-assembly-descriptor</artifactId>
+ <version>${version.apache-resource-bundles}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>source-release-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
+ <descriptorRefs>
+
<descriptorRef>${sourceReleaseAssemblyDescriptor}</descriptorRef>
+ </descriptorRefs>
+
<tarLongFileMode>${assembly.tarLongFileMode}</tarLongFileMode>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- calculate checksums of source release for Apache dist area -->
+ <plugin>
+ <groupId>net.nicoulaj.maven.plugins</groupId>
+ <artifactId>checksum-maven-plugin</artifactId>
+ <version>${version.checksum-maven-plugin}</version>
+ <executions>
+ <execution>
+ <id>source-release-checksum</id>
+ <goals>
+ <goal>artifacts</goal>
+ </goals>
+ <!-- execute prior to maven-gpg-plugin:sign due to
https://github.com/nicoulaj/checksum-maven-plugin/issues/112 -->
+ <phase>post-integration-test</phase>
+ <configuration>
+ <algorithms>
+ <algorithm>SHA-512</algorithm>
+ </algorithms>
+ <!--
https://maven.apache.org/apache-resource-bundles/#source-release-assembly-descriptor
-->
+ <includeClassifiers>source-release</includeClassifiers>
+ <excludeMainArtifact>true</excludeMainArtifact>
+ <csvSummary>false</csvSummary>
+ <!-- attach SHA-512 checksum as well to upload to Maven
Staging Repo,
+ as this eases uploading from stage to dist and doesn't
do harm in Maven Central -->
+ <attachChecksums>true</attachChecksums>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- We want to sign the artifact, the POM, and all attached
artifacts (except for SHA-512 checksum) -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>sign-release-artifacts</id>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
diff --git a/release/asf-settings.xml b/release/asf-settings.xml
new file mode 100644
index 000000000..b6388f7e6
--- /dev/null
+++ b/release/asf-settings.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
+ <servers>
+ <server>
+ <id>apache.snapshots.https</id>
+ <username>${env.ASF_USERNAME}</username>
+ <password>${env.ASF_PASSWORD}</password>
+ </server>
+ <server>
+ <id>apache.releases.https</id>
+ <username>${env.ASF_USERNAME}</username>
+ <password>${env.ASF_PASSWORD}</password>
+ </server>
+ </servers>
+</settings>
diff --git a/release/publish_maven_artifacts.sh
b/release/publish_maven_artifacts.sh
new file mode 100755
index 000000000..322a4a90c
--- /dev/null
+++ b/release/publish_maven_artifacts.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set -o pipefail
+set -e
+set -x
+
+ASF_USERNAME=${ASF_USERNAME:?"ASF_USERNAME is required"}
+ASF_PASSWORD=${ASF_PASSWORD:?"ASF_PASSWORD is required"}
+
+PROJECT_DIR="$(cd "$(dirname "$0")"/..; pwd)"
+cd $PROJECT_DIR
+
+upload_nexus_staging() {
+ echo "Deploying rss-client-spark2-shaded"
+ mvn clean install -DskipTests -Papache-release,spark2 \
+ -s "${PROJECT_DIR}/release/asf-settings.xml" \
+ -pl :rss-client-spark2-shaded -Dmaven.javadoc.skip=true -am
+ mvn deploy -DskipTests -Papache-release,spark2 \
+ -s "${PROJECT_DIR}/release/asf-settings.xml" \
+ -pl :rss-client-spark2-shaded -Dmaven.javadoc.skip=true
+
+ echo "Deploying rss-client-spark3-shaded"
+ mvn clean install -DskipTests -Papache-release,spark3 \
+ -s "${PROJECT_DIR}/release/asf-settings.xml" \
+ -pl :rss-client-spark3-shaded -Dmaven.javadoc.skip=true -am
+ mvn deploy -DskipTests -Papache-release,spark3 \
+ -s "${PROJECT_DIR}/release/asf-settings.xml" \
+ -pl :rss-client-spark3-shaded -Dmaven.javadoc.skip=true
+}
+
+upload_nexus_staging