Skip to content

Commit

Permalink
Added release automation for dist/dev svn and SBOM (#1585)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Cosentino <[email protected]>
  • Loading branch information
oscerd authored Jan 15, 2024
1 parent b46a3ff commit 80d2f85
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 4 deletions.
21 changes: 17 additions & 4 deletions docs/modules/ROOT/pages/contributor-guide/release-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] 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:
Expand Down Expand Up @@ -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`
Expand All @@ -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
Expand Down
25 changes: 25 additions & 0 deletions release-utils/scripts/promote-release.sh
Original file line number Diff line number Diff line change
@@ -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"
35 changes: 35 additions & 0 deletions release-utils/scripts/sign.sh
Original file line number Diff line number Diff line change
@@ -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
41 changes: 41 additions & 0 deletions release-utils/scripts/upload-source.sh
Original file line number Diff line number Diff line change
@@ -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/

0 comments on commit 80d2f85

Please sign in to comment.