Skip to content

Commit

Permalink
Merge pull request #60 from aiven/jjaakola-aiven-add-mirrormaker-offs…
Browse files Browse the repository at this point in the history
…et-sync-tool-release-script

chore: release script for offset sync tool
  • Loading branch information
keejon authored Oct 9, 2024
2 parents 7cfe2b8 + e2d628f commit a6bd24b
Show file tree
Hide file tree
Showing 2 changed files with 62 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

- name: Build
run: |
github_ref=${{ github.ref }}
mm2_offset_sync_inspector_version=$(echo ${github_ref##*-})
MM2_OFFSET_SYNC_INSPECTOR_VERSION=${mm2_offset_sync_inspector_version} ./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 }}
22 changes: 22 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3496,6 +3496,28 @@ project(':connect:mirror') {
jar {
dependsOn copyDependantLibs
}

tasks.create(name: "releaseMirrorMaker2OffsetToolInspectorTarGz", dependsOn: configurations.archives.artifacts, type: Tar) {
def mm2OffsetSyncInspectorVersion = System.getenv("MM2_OFFSET_SYNC_INSPECTOR_VERSION")
if (mm2OffsetSyncInspectorVersion == null) {
mm2OffsetSyncInspectorVersion = "SNAPSHOT"
}
var commitHash = determineCommitId()
into "kafka_mm2_offset_tool_inspector_g${versions.baseScala}-${commitHash}-${mm2OffsetSyncInspectorVersion}"
archiveFileName = "mm2_offset_tool_inspector_${versions.baseScala}-g${commitHash}-${mm2OffsetSyncInspectorVersion}.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 a6bd24b

Please sign in to comment.