diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6d7613..7cd96e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,6 @@ jobs: distribution: "temurin" cache: maven - name: Publish package - run: mvn --batch-mode deploy + run: ./bin/deploy-multi.sh env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/bin/deploy-multi.sh b/bin/deploy-multi.sh new file mode 100755 index 0000000..4e361c5 --- /dev/null +++ b/bin/deploy-multi.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +if test \! -f pom.xml +then + echo "Must be run from the directory of the pom.xml file" + exit 1 +fi + +KAFKA_VERSIONS="3.6.0 3.5.1" +CURRENT_VERSION="$(grep '' pom.xml | head -1 | sed -re 's/[[:space:]]*(.*)<\/version>[[:space:]]*/\1/')" + +mvn --batch-mode deploy +cp pom.xml pom.xml.old +for KAFKA_VERSION in $KAFKA_VERSIONS +do + NEW_VERSION="$CURRENT_VERSION"+"$KAFKA_VERSION" + echo "$NEW_VERSION" + mvn versions:set -DnewVersion="$NEW_VERSION" + mvn versions:commit + sed -i~ -re 's/.*<\/kafka.version>/'"$KAFKA_VERSION"'<\/kafka.version>/' pom.xml + mvn --batch-mode deploy +done +mv pom.xml.old pom.xml +rm -f pom.xml.versionsBackup