Skip to content

Commit

Permalink
chore: Some improvements added during the last release attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdutz committed Feb 16, 2024
1 parent ed758a0 commit 276a6b2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tools/release-1-create-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# under the License.
# ----------------------------------------------------------------------------

DIRECTORY=$(pwd)

# 0. Check if there are uncommitted changes as these would automatically be committed (local)
if [[ $(git status --porcelain) ]]; then
# Changes
Expand Down Expand Up @@ -49,7 +51,7 @@ case $yn in
esac

# 3. Do a simple maven branch command with pushChanges=false
../mvnw -f ../pom.xml -e -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox -Dmaven.repo.local=../out/.repository release:branch -DautoVersionSubmodules=true -DpushChanges=false -DdevelopmentVersion="$NEW_VERSION" -DbranchName="$BRANCH_NAME"
../mvnw -f ../pom.xml -e -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox -Dmaven.repo.local=$DIRECTORY/../out/.repository release:branch -DautoVersionSubmodules=true -DpushChanges=false -DdevelopmentVersion="$NEW_VERSION" -DbranchName="$BRANCH_NAME"
if [ $? -ne 0 ]; then
echo "Got non-0 exit code from docker compose, aborting."
exit 1
Expand Down
4 changes: 3 additions & 1 deletion tools/release-2-prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# under the License.
# ----------------------------------------------------------------------------

DIRECTORY=$(pwd)

# 0. Check if there are uncommitted changes as these would automatically be committed (local)
if [[ $(git status --porcelain) ]]; then
# Changes
Expand All @@ -32,7 +34,7 @@ IFS='.' read -ra VERSION_SEGMENTS <<< "$RELEASE_VERSION"
NEW_VERSION="${VERSION_SEGMENTS[0]}.${VERSION_SEGMENTS[1]}.$((VERSION_SEGMENTS[2] + 1))-SNAPSHOT"

# 1. Do a simple release-prepare command
../mvnw -f ../pom.xml -e -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox -Dmaven.repo.local=../out/.repository release:prepare -DautoVersionSubmodules=true -DreleaseVersion="$RELEASE_VERSION" -DdevelopmentVersion="$NEW_VERSION" -Dtag="v$RELEASE_VERSION"
../mvnw -f ../pom.xml -e -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,update-generated-code -Dmaven.repo.local=$DIRECTORY/../out/.repository release:prepare -DautoVersionSubmodules=true -DreleaseVersion="$RELEASE_VERSION" -DdevelopmentVersion="$NEW_VERSION" -Dtag="v$RELEASE_VERSION"
if [ $? -ne 0 ]; then
echo "Got non-0 exit code from docker compose, aborting."
exit 1
Expand Down
12 changes: 12 additions & 0 deletions tools/release-3-perform-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,30 @@
# 0. Check if the release properties file exists.

# 1. Do a simple release-perform command skip signing of artifacts and deploy to local directory (inside the Docker container)
echo "Performing Release:"
docker compose run --rm releaser bash /ws/mvnw -e -Dmaven.repo.local=/ws/out/.repository -DaltDeploymentRepository=snapshot-repo::default::file:/ws/out/.local-artifacts-dir release:perform
if [ $? -ne 0 ]; then
echo "Got non-0 exit code from docker compose, aborting."
exit 1
fi

# 2. Sign all artifacts
echo "Signing artifacts:"
find ./out/.local-artifacts-dir -print | grep -E '^((.*\.pom)|(.*\.jar)|(.*\.kar)|(.*\.nar)|(.*-features\.xml)|(.*-cycloneds\.json)|(.*-cycloneds\.xml)|(.*-site\.xml)|(.*\.zip))$' | while read -r line ; do
echo "Processing $line"
gpg -ab "$line"
done

# 3. Deploy the artifacts to Nexus
echo "Deploying artifacts:"
../mvnw -f jenkins.pom -X -P deploy-releases wagon:upload
if [ $? -ne 0 ]; then
echo "Got non-0 exit code from maven deployment, aborting."
exit 1
fi

# 4. Prepare a directory for the release candidate
echo "Staging release candidate:"
RELEASE_VERSION=$(find ../out/.local-artifacts-dir/org/apache/plc4x/plc4x-parent/ -maxdepth 1 -type d | grep -vE 'plc4x-parent/$' | xargs -n 1 basename)
mkdir -p "../out/stage/${RELEASE_VERSION}/rc1"
cp ../README.md "../out/stage/${RELEASE_VERSION}/rc1/README"
Expand Down

0 comments on commit 276a6b2

Please sign in to comment.