This is an automated email from the ASF dual-hosted git repository. robbie pushed a commit to branch development in repository https://gitbox.apache.org/repos/asf/activemq-artemis-examples.git
commit 0e397aed9b2ac97cf54311ac2105720896d09aa8 Author: Robbie Gemmell <[email protected]> AuthorDate: Tue Apr 15 15:33:51 2025 +0100 NO-JIRA: tweak update-examples-version.sh not to use Maven, faster and operates without [old/deleted] snapshots access --- .github/workflows/build.yml | 6 ++---- scripts/update-examples-version.sh | 16 ++++++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5080a2..9fa13f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,8 +80,7 @@ jobs: if: ${{ (github.event_name == 'pull_request' && github.base_ref != 'main') || (github.event_name != 'pull_request' && github.ref != 'refs/heads/main') }} run: | cd activemq-artemis-examples - sed -i "/<parent>/,/<version>/ s~<version>[^<]*~<version>${{ steps.identify-artemis-version.outputs.artemis-build-version }}~g" ./pom.xml - CURRENT_EXAMPLES_BUILD_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + CURRENT_EXAMPLES_BUILD_VERSION=$(grep -m 1 -Po '(?<=version>)[^<]+' pom.xml) echo "Current Examples version: ${CURRENT_EXAMPLES_BUILD_VERSION}" echo "examples-build-version=${CURRENT_EXAMPLES_BUILD_VERSION}" >> $GITHUB_OUTPUT @@ -159,8 +158,7 @@ jobs: if: ${{ (github.event_name == 'pull_request' && github.base_ref != 'main') || (github.event_name != 'pull_request' && github.ref != 'refs/heads/main') }} run: | cd activemq-artemis-examples - sed -i "/<parent>/,/<version>/ s~<version>[^<]*~<version>${{ steps.identify-artemis-version.outputs.artemis-build-version }}~g" ./pom.xml - CURRENT_EXAMPLES_BUILD_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + CURRENT_EXAMPLES_BUILD_VERSION=$(grep -m 1 -Po '(?<=version>)[^<]+' pom.xml) echo "Current Examples version: ${CURRENT_EXAMPLES_BUILD_VERSION}" echo "examples-build-version=${CURRENT_EXAMPLES_BUILD_VERSION}" >> $GITHUB_OUTPUT diff --git a/scripts/update-examples-version.sh b/scripts/update-examples-version.sh index dd4d4ae..f6f05ee 100755 --- a/scripts/update-examples-version.sh +++ b/scripts/update-examples-version.sh @@ -49,11 +49,11 @@ fi NEW_VERSION="$1" echo "Setting examples version to ${NEW_VERSION}" -# Update root pom parent pom version -echo "Updating root pom *parent* version" -sed -i.bak "/<parent>/,/<version>/ s~<version>[^<]*~<version>${NEW_VERSION}~g w /dev/stdout" ./pom.xml -rm -f pom.xml.bak - -# Update root pom version and all the child modules to match -echo "Updating root pom version and child modules" -mvn versions:set -DgroupId="org.apache.activemq.examples.*" -DgenerateBackupPoms=false -DprocessAllModules=true -DnewVersion="${NEW_VERSION}" -DprocessFromLocalAggregationRoot=false +# Update base pom version element +sed -i.bak "/<\/parent>/,/<version>/ s~<version>[^<]*~<version>${NEW_VERSION}~g" ./pom.xml + +# Update parent pom version element for base pom and all other poms +find . -path '*/target' -type d -prune -false -o -type f -name 'pom.xml' -print0 | xargs -0 sed -i.bak "/<parent>/,/<version>/ s~<version>[^<]*~<version>${NEW_VERSION}~g" + +# Clear out pom.xml.bak files +find . -name "pom.xml.bak" -type f -exec rm -f '{}' \; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information, visit: https://activemq.apache.org/contact
