Skip to content

Commit

Permalink
chore: release script for offset sync tool
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaakola-aiven committed Sep 26, 2024
1 parent 85350c2 commit ba597c9
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/mirrormaker_offset_tool_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# The workflow to create PRs with release commits.
name: Create Mirrormaker Offset Sync Inspector release
on:
push:
tags:
- mm2-offset-sync-inspector-*

permissions:
contents: write

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Setup Java SDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: "temurin"

- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit_hash }}

- name: Build
run: |
./gradlew :connect:mirror:releaseMirrorMaker2OffsetToolInspectorTarGz
export release_file=$(ls ./connect/mirror/build/distributions/ | grep tgz)
echo release_file=${release_file} >> $GITHUB_ENV
echo release_file_path=`realpath ./connect/mirror/build/distributions/${release_file}` >> $GITHUB_ENV
- name: Upload MirrorMaker Offset Inspector tgz
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/mm2-offset-sync-inspector-')
with:
files: ${{ env.release_file_path }}
17 changes: 17 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3496,6 +3496,23 @@ project(':connect:mirror') {
jar {
dependsOn copyDependantLibs
}

tasks.create(name: "releaseMirrorMaker2OffsetToolInspectorTarGz", dependsOn: configurations.archives.artifacts, type: Tar) {
into "kafka_mm2_offset_tool_inspector_${versions.baseScala}-${archiveVersion.get()}"
archiveFileName = "kafka_mm2_offset_tool_inspector_${versions.baseScala}-${archiveVersion.get()}.tgz"
compression = Compression.GZIP
from(project.file("$rootDir/bin/kafka-mirrormaker-offset-sync-inspector.sh")) { into "bin/" }
from(project.file("$rootDir/bin/kafka-run-class.sh")) { into "bin/" }
from(project.file("$rootDir/licenses")) { into "licenses/" }
from "$rootDir/LICENSE-binary" rename {String filename -> filename.replace("-binary", "")}
from "$rootDir/NOTICE-binary" rename {String filename -> filename.replace("-binary", "")}
from(project(':clients').jar) { into("libs/") }
from(project(':clients').configurations.runtimeClasspath) { into("libs/") }
from(project(':connect:mirror').jar) { into("libs/") }
from(project(':connect:mirror').configurations.runtimeClasspath) { into("libs/") }
duplicatesStrategy 'exclude'
}

}

project(':connect:mirror-client') {
Expand Down

0 comments on commit ba597c9

Please sign in to comment.