You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2024/01/15 11:01:49 UTC

(camel-kafka-connector) 01/01: Added release automation for dist/dev svn and SBOM

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch release-utils-fix
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit 4aab61ff4c2f16d713324093e784fe6641705693
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Jan 15 12:00:38 2024 +0100

    Added release automation for dist/dev svn and SBOM
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../pages/contributor-guide/release-guide.adoc     | 21 ++++++++---
 release-utils/scripts/promote-release.sh           | 25 +++++++++++++
 release-utils/scripts/sign.sh                      | 35 ++++++++++++++++++
 release-utils/scripts/upload-source.sh             | 41 ++++++++++++++++++++++
 4 files changed, 118 insertions(+), 4 deletions(-)

diff --git a/docs/modules/ROOT/pages/contributor-guide/release-guide.adoc b/docs/modules/ROOT/pages/contributor-guide/release-guide.adoc
index fde3c3633..84042351b 100644
--- a/docs/modules/ROOT/pages/contributor-guide/release-guide.adoc
+++ b/docs/modules/ROOT/pages/contributor-guide/release-guide.adoc
@@ -97,6 +97,21 @@ $ ./mvnw -Prelease -Dusername=<your_apache_username> -Dpassword=<your_apache_pas
 
 There will be some checks done by nexus, wiat tho see that they complete successfully.
 
+== Upload the staging sources to Apache dev server
+
+Upload the files:
+
+ * `distribution/target/camel-kafka-connector-<the_version_you_released>-src.zip`
+ * `distribution/target/camel-kafka-connector-<the_version_you_released>-src.zip.asc`
+ * `distribution/target/camel-kafka-connector-<the_version_you_released>-src.zip.sha512`
+
+to apache dist svn:
+
+[source,shell]
+----
+$ release-utils/scripts/upload-source.sh <the_version_you_released> <the_version_you_released>
+----
+
 == Open the vote
 
 Send an email to dev@camel.apache.org with object: `[VOTE] Release Camel-Kafka-connector <the_version_you_want_to_release>` you can select 48 or 72 hours for the vote. The message can be something like:
@@ -157,6 +172,7 @@ Regards.
 * release it
 
 == Upload the sources to Apache dist server
+
 Upload the files:
 
  * `distribution/target/camel-kafka-connector-<the_version_you_released>-src.zip`
@@ -167,10 +183,7 @@ to apache dist svn:
 
 [source,shell]
 ----
-$ cd distribution/target
-$ mkdir releases
-$ cp camel-kafka-connector-<the_version_you_released>-src.zip camel-kafka-connector-<the_version_you_released>-src.zip.asc camel-kafka-connector-<the_version_you_released>-src.zip.sha512 releses/
-$ svn import release/ https://dist.apache.org/repos/dist/release/camel/camel-kafka-connector/<the_version_you_released> -m"Camel Kafka Connector <the_version_you_released> import."
+$ release-utils/scripts/promote-release.sh <the_version_you_released>
 ----
 
 == Create a release note
diff --git a/release-utils/scripts/promote-release.sh b/release-utils/scripts/promote-release.sh
new file mode 100755
index 000000000..22846b7d0
--- /dev/null
+++ b/release-utils/scripts/promote-release.sh
@@ -0,0 +1,25 @@
+#!/bin/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 -e
+
+if [ "$#" -lt 1 ]; then
+    echo "usage: $0 promote-release release-version"
+    exit 1
+fi
+
+svn mv https://dist.apache.org/repos/dist/dev/camel/camel-kafka-connector/$1/ https://dist.apache.org/repos/dist/release/camel/camel-kafka-connector/$1/ -m "Promote release from dev to release"
diff --git a/release-utils/scripts/sign.sh b/release-utils/scripts/sign.sh
new file mode 100755
index 000000000..7aafd1047
--- /dev/null
+++ b/release-utils/scripts/sign.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# 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.
+
+# This is a utility script to sign and sha512 all files in the given directory.
+
+if [ "$#" -ne 1 ]; then
+    echo "usage: $0 dir"
+    exit 1
+fi
+
+dir=$1
+
+pushd . && cd $dir
+
+for f in $(ls);
+do
+    sha512sum -b $f > $f.sha512
+    gpg --output $f.asc --armor --detach-sig $f
+done
+
+popd
diff --git a/release-utils/scripts/upload-source.sh b/release-utils/scripts/upload-source.sh
new file mode 100755
index 000000000..74249ee87
--- /dev/null
+++ b/release-utils/scripts/upload-source.sh
@@ -0,0 +1,41 @@
+#!/bin/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 -e
+
+if [ "$#" -lt 2 ]; then
+    echo "usage: $0 upload-sources release-version destination-version"
+    exit 1
+fi
+
+location=$(dirname $0)
+version=$1
+
+mkdir $1/
+cd $1/
+
+distribution/target
+cp ../../../distribution/target/camel-kafka-connector-$1-src.zip .
+cp ../../../distribution/target/camel-kafka-connector-$1-src.zip.asc .
+cp ../../../distribution/target/camel-kafka-connector-$1-src.zip.sha512 .
+cp ../../../target/camel-kafka-connector-$1.json camel-kafka-connector-$1-sbom.json
+cp ../../../target/camel-kafka-connector-$1.xml camel-kafka-connector-$1-sbom.xml
+cd ../
+./sign.sh $1/
+svn import $1/ https://dist.apache.org/repos/dist/dev/camel/camel-kafka-connector/$2/ -m "Import camel-kafka-connector release"
+
+rm -rf $1/