Skip to content

Commit

Permalink
Merge pull request #287 from Aiven-Open/eliax1996/fix-release-script-…
Browse files Browse the repository at this point in the history
…for-new-project-structure

build: update the bump script to manage the upgrade of all the connectors in the repo
  • Loading branch information
muralibasani authored Sep 13, 2024
2 parents 510763e + b4f9726 commit 2b8c441
Show file tree
Hide file tree
Showing 85 changed files with 100 additions and 120 deletions.
50 changes: 38 additions & 12 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,19 @@ jobs:
run: |
./gradlew distTar distZip
export tar_file=$(ls ./build/distributions/ | grep tar)
export zip_file=$(ls ./build/distributions/ | grep zip)
echo tar_file=${tar_file} >> $GITHUB_ENV
echo zip_file=${zip_file} >> $GITHUB_ENV
export gcs_tar_file=$(ls ./gcs-sink-connector/build/distributions/ | grep tar)
export gcs_zip_file=$(ls ./gcs-sink-connector/build/distributions/ | grep zip)
echo gcs_tar_file=${gcs_tar_file} >> $GITHUB_ENV
echo gcs_zip_file=${gcs_zip_file} >> $GITHUB_ENV
echo gcs_tar_path=`realpath ./gcs-sink-connector/build/distributions/${gcs_tar_file}` >> $GITHUB_ENV
echo gcs_zip_path=`realpath ./gcs-sink-connector/build/distributions/${gcs_zip_file}` >> $GITHUB_ENV
echo tar_path=`realpath ./build/distributions/${tar_file}` >> $GITHUB_ENV
echo zip_path=`realpath ./build/distributions/${zip_file}` >> $GITHUB_ENV
export s3_tar_file=$(ls ./s3-sink-connector/build/distributions/ | grep tar)
export s3_zip_file=$(ls ./s3-sink-connector/build/distributions/ | grep zip)
echo s3_tar_file=${s3_tar_file} >> $GITHUB_ENV
echo s3_zip_file=${s3_zip_file} >> $GITHUB_ENV
echo s3_tar_path=`realpath ./s3-sink-connector/build/distributions/${s3_tar_file}` >> $GITHUB_ENV
echo s3_zip_path=`realpath ./s3-sink-connector/build/distributions/${s3_tar_file}` >> $GITHUB_ENV
- name: Create tag
run: |
Expand All @@ -77,22 +83,42 @@ jobs:
draft: true
prerelease: false

- name: Upload tar
- name: Upload tar GCS
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.tar_path }}
asset_name: ${{ env.tar_file }}
asset_path: ${{ env.gcs_tar_path }}
asset_name: ${{ env.gcs_tar_file }}
asset_content_type: application/tar

- name: Upload zip
- name: Upload zip GCS
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.zip_path }}
asset_name: ${{ env.zip_file }}
asset_path: ${{ env.gcs_zip_path }}
asset_name: ${{ env.gcs_zip_file }}
asset_content_type: application/zip

- name: Upload tar S3
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.s3_tar_path }}
asset_name: ${{ env.s3_tar_file }}
asset_content_type: application/tar

- name: Upload zip S3
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.s3_zip_path }}
asset_name: ${{ env.s3_zip_file }}
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion .github/workflows/release_pr_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
ref: ${{ github.ref }}
fetch-depth: 0

- name: Create release commits
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Aiven's Apache Kafka Connectors

- [Aiven Connector Commons](./commons/README.md)
- [Aiven GCS Connector](./gcs-connector/README.md)
- [Aiven S3 Connector](./s3-connector/README.md)
- [Aiven GCS Sink Connector](./gcs-sink-connector/README.md)
- [Aiven S3 Sink Connector](./s3-sink-connector/README.md)

# Development

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,21 @@ spotless {
}
}

val distTar by tasks.getting(Tar::class) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
distributions {
main {
contents {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(tasks.jar)
from(configurations.runtimeClasspath.get())

into("/") {
from("$projectDir")
include("README*", "notices/", "licenses/")
include("config/")
from("$rootDir") {
include("LICENSE*")
}
}
}
}
}
val distZip by tasks.getting(Zip::class) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
6 changes: 3 additions & 3 deletions commons/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Aiven's Common Module for Apache Kafka® connectors

Shared common functionality among Aiven's connectors for Apache Kafka:
- [Aiven GCS Connector](../gcs-connector/README.md)
- [Aiven S3 Connector](../s3-connector/README.md)
- [Aiven GCS Sink Connector](../gcs-sink-connector/README.md)
- [Aiven S3 Sink Connector](../s3-sink-connector/README.md)

# Usage

Expand All @@ -16,7 +16,7 @@ When installing this library on Kafka Connect, use a specific plugin path, and *

# License

This project is licensed under the [Apache License, Version 2.0](LICENSE).
This project is licensed under the [Apache License, Version 2.0](../LICENSE).

# Trademarks

Expand Down
24 changes: 5 additions & 19 deletions commons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,6 @@ dependencies {
testRuntimeOnly(logginglibs.logback.classic)
}

distributions {
main {
contents {
from(tasks.jar)
from(configurations.runtimeClasspath.get())

into("/") {
from("$projectDir")
include("version.txt", "README*", "LICENSE*", "NOTICE*", "licenses/")
include("config/")
}
}
}
}

publishing {
publications {
create<MavenPublication>("publishMavenJavaArtifact") {
Expand Down Expand Up @@ -142,10 +127,11 @@ publishing {
}

scm {
connection = "scm:git:git://github.com:aiven-open/commons-for-apache-kafka-connect.git"
connection =
"scm:git:git://github.com:Aiven-Open/cloud-storage-connectors-for-apache-kafka.git"
developerConnection =
"scm:git:ssh://github.com:aiven-open/commons-for-apache-kafka-connect.git"
url = "https://github.com/aiven-open/commons-for-apache-kafka-connect"
"scm:git:ssh://github.com:Aiven-Open/cloud-storage-connectors-for-apache-kafka.git"
url = "https://github.com/Aiven-Open/cloud-storage-connectors-for-apache-kafka"
}
}
}
Expand All @@ -172,7 +158,7 @@ signing {
// This results in double armored signatures, i.e. garbage.
// Override the signature type provider to use unarmored output for `asc` files, which works well
// with GPG.
class ASCSignatureProvider() : AbstractSignatureTypeProvider() {
class ASCSignatureProvider : AbstractSignatureTypeProvider() {
val binary =
object : BinarySignatureType() {
override fun getExtension(): String {
Expand Down
11 changes: 0 additions & 11 deletions gcs-connector/gradle.properties

This file was deleted.

File renamed without changes.
6 changes: 3 additions & 3 deletions gcs-connector/README.md → gcs-sink-connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ Here is an example connector configuration with descriptions:

# Unique name for the connector.
# Attempting to register again with the same name will fail.
name=my-gcs-connector
name=my-gcs-sink-connector

## These must have exactly these values:

Expand Down Expand Up @@ -643,7 +643,7 @@ Release JARs are available in Maven Central:
```xml
<dependency>
<groupId>io.aiven</groupId>
<artifactId>gcs-connector-for-apache-kafka</artifactId>
<artifactId>gcs-sink-connector-for-apache-kafka</artifactId>
<version>x.y.z</version>
</dependency>
```
Expand Down Expand Up @@ -704,7 +704,7 @@ TBD

## License

This project is licensed under the [Apache License, Version 2.0](LICENSE).
This project is licensed under the [Apache License, Version 2.0](../LICENSE).

## Trademarks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import com.github.spotbugs.snom.SpotBugsTask

plugins { id("aiven-apache-kafka-connectors-all.java-conventions") }

group = "io.aiven"

val kafkaVersion by extra("1.1.0")

val integrationTest: SourceSet =
Expand Down Expand Up @@ -63,7 +61,7 @@ tasks.register<Test>("integrationTest") {
// Pass the GCS bucket name to the tests.
systemProperty("integration-test.gcs.bucket", project.findProperty("testGcsBucket").toString())
// Pass the distribution file path to the tests.
val distTarTask = tasks.get("distTar") as Tar
val distTarTask = tasks["distTar"] as Tar
val distributionFilePath = distTarTask.archiveFile.get().asFile.path
systemProperty("integration-test.distribution.file.path", distributionFilePath)
systemProperty("fake-gcs-server-version", "1.45.2")
Expand Down Expand Up @@ -172,41 +170,26 @@ tasks.named<SpotBugsTask>("spotbugsIntegrationTest") {
}

tasks.processResources {
filesMatching("gcs-connector-for-apache-kafka-version.properties") {
filesMatching("gcs-sink-connector-for-apache-kafka-version.properties") {
expand(mapOf("version" to version))
}
}

tasks.jar { manifest { attributes(mapOf("Version" to project.version)) } }

tasks.distTar { dependsOn(":commons:jar") }

tasks.distZip { dependsOn(":commons:jar") }

distributions {
main {
contents {
from(tasks.jar)
from(configurations.runtimeClasspath.get())
}
}
}

tasks.installDist { dependsOn(":commons:jar") }

publishing {
publications {
create<MavenPublication>("publishMavenJavaArtifact") {
groupId = group.toString()
artifactId = "gcs-connector-for-apache-kafka"
artifactId = "gcs-sink-connector-for-apache-kafka"
version = version.toString()

from(components["java"])

pom {
name = "Aiven's GCS Sink Connector for Apache Kafka"
description = "Aiven's GCS Sink Connector for Apache Kafka"
url = "https://github.com/aiven/gcs-connector-for-apache-kafka"
url = "https://github.com/Aiven-Open/Aiven-Open/cloud-storage-connectors-for-apache-kafka"
organization {
name = "Aiven Oy"
url = "https://aiven.io"
Expand All @@ -229,9 +212,11 @@ publishing {
}

scm {
connection = "scm:git:git://github.com:aiven/gcs-connector-for-apache-kafka.git"
developerConnection = "scm:git:ssh://github.com:aiven/gcs-connector-for-apache-kafka.git"
url = "https://github.com/aiven/gcs-connector-for-apache-kafka"
connection =
"scm:git:git://github.com:Aiven-Open/cloud-storage-connectors-for-apache-kafka.git"
developerConnection =
"scm:git:ssh://github.com:Aiven-Open/cloud-storage-connectors-for-apache-kafka.git"
url = "https://github.com/Aiven-Open/cloud-storage-connectors-for-apache-kafka"
}
}
}
Expand All @@ -258,7 +243,7 @@ signing {
// This results in double armored signatures, i.e. garbage.
// Override the signature type provider to use unarmored output for `asc` files, which works well
// with GPG.
class ASCSignatureProvider() : AbstractSignatureTypeProvider() {
class ASCSignatureProvider : AbstractSignatureTypeProvider() {
val binary =
object : BinarySignatureType() {
override fun getExtension(): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ static void setUpAll() throws IOException, InterruptedException {
testBucketAccessor = new BucketAccessor(storage, testBucketName);
testBucketAccessor.ensureWorking();

gcsPrefix = "gcs-connector-for-apache-kafka-test-"
gcsPrefix = "gcs-sink-connector-for-apache-kafka-test-"
+ ZonedDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME) + "/";

final File testDir = Files.createTempDirectory("gcs-connector-for-apache-kafka-test-").toFile();
final File testDir = Files.createTempDirectory("gcs-sink-connector-for-apache-kafka-test-").toFile();

pluginDir = new File(testDir, "plugins/gcs-connector-for-apache-kafka/");
pluginDir = new File(testDir, "plugins/gcs-sink-connector-for-apache-kafka/");
assert pluginDir.mkdirs();

final File distFile = new File(System.getProperty("integration-test.distribution.file.path"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class Version {
private static final Logger LOG = LoggerFactory.getLogger(Version.class);

private static final String PROPERTIES_FILENAME = "gcs-connector-for-apache-kafka-version.properties";
private static final String PROPERTIES_FILENAME = "gcs-sink-connector-for-apache-kafka-version.properties";

static final String VERSION; // NOPMD field name matches class name

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void unlimited(@ForAll("recordBatches") final List<List<SinkRecord>> recordBatch
}

@Property
@Disabled("See https://github.com/aiven/gcs-connector-for-apache-kafka/issues/143")
@Disabled("See https://github.com/Aiven-Open/commons-for-apache-kafka-connect/issues/261")
void limited(@ForAll("recordBatches") final List<List<SinkRecord>> recordBatches,
@ForAll @IntRange(min = 1, max = 100) final int maxRecordsPerFile) {
genericTry(recordBatches, maxRecordsPerFile);
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion s3-connector/gradle.properties → gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version=0.13.0-SNAPSHOT
version=0.14.0-SNAPSHOT

sonatypeUsername=<fill>
sonatypePassword=<fill>

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion s3-connector/README.md → s3-sink-connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ directory:

## License

This project is licensed under the [Apache License, Version 2.0](LICENSE).
This project is licensed under the [Apache License, Version 2.0](../LICENSE).

## Trademarks

Expand Down
Loading

0 comments on commit 2b8c441

Please sign in to comment.