Skip to content

Commit

Permalink
feat: build for multiple Kafka versions (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverrehu authored Oct 6, 2023
1 parent 9fd39e0 commit 4224477
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
24 changes: 24 additions & 0 deletions bin/deploy-multi.sh
Original file line number Diff line number Diff line change
@@ -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 '<version>' pom.xml | head -1 | sed -re 's/[[:space:]]*<version>(.*)<\/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>'"$KAFKA_VERSION"'<\/kafka.version>/' pom.xml
mvn --batch-mode deploy
done
mv pom.xml.old pom.xml
rm -f pom.xml.versionsBackup

0 comments on commit 4224477

Please sign in to comment.