Skip to content

Commit 9ab8e25

Browse files
committed
build: update pom.xml and ci workflows
1 parent 6fd8b11 commit 9ab8e25

File tree

30 files changed

+645
-499
lines changed

30 files changed

+645
-499
lines changed
+32-40
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,62 @@
1-
name: Docker Builds
1+
name: Docker Builds & Push
22
on:
33
push:
44
branches:
5-
- master
6-
- main
5+
- 'master'
6+
tags:
7+
- 'v*'
8+
env:
9+
JAVA_VERSION: '11'
10+
JAVA_DISTRO: 'zulu'
11+
712
jobs:
8-
build_docker_image:
13+
build:
914
if: github.repository == 'streamthoughts/kafka-connect-file-pulse'
10-
name: Build docker image
15+
name: 'Build Docker Image'
1116
runs-on: ubuntu-latest
1217
steps:
1318
- uses: actions/checkout@v3
1419
- uses: docker/setup-buildx-action@v1
1520

16-
- name: Set up JDK 11
21+
- name: 'Set Docker Image Build-Args'
22+
run: |
23+
echo "VERSION=$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
24+
echo "GIT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
25+
echo "GIT_COMMIT=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV
26+
echo "CREATED=$(date --rfc-3339=seconds)" >> $GITHUB_ENV
27+
28+
- name: 'Set up Java'
1729
uses: actions/setup-java@v3
1830
with:
19-
java-version: '11'
20-
distribution: 'adopt'
21-
22-
- name: Grant execute permission for mvnw
23-
run: chmod +x mvnw
24-
25-
- name: Build with Maven
26-
run: ./mvnw clean package -B -Dmaven.test.skip=true;
27-
28-
- name: Set env PROJECT_VERSION
29-
run: echo "PROJECT_VERSION=$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
30-
31-
- name: Copy distribution
32-
run: cp ./connect-file-pulse-plugin/target/components/packages/streamthoughts-kafka-connect-file-pulse-${{ env.PROJECT_VERSION }}.zip ./docker/ \
33-
34-
- name: Check PROJECT_VERSION
35-
run: echo "${{ env.PROJECT_VERSION }}"
36-
37-
- name: Set env GIT_BRANCH
38-
run: echo "GIT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
39-
40-
- name: Check GIT_BRANCH
41-
run: echo "${{ env.GIT_BRANCH }}"
42-
43-
- name: Set GIT_COMMIT
44-
run: echo "GIT_COMMIT=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV
31+
java-version: ${{ env.JAVA_VERSION }}
32+
distribution: ${{ env.JAVA_DISTRO }}
33+
cache: 'maven'
4534

46-
- name: Check GIT_COMMIT
47-
run: echo "${{ env.GIT_COMMIT }}"
35+
- name: 'Build with Maven'
36+
run: |
37+
chmod +x mvnw
38+
./mvnw -ntp -B --file pom.xml -Pdist package -DskipTests
4839
49-
- name: Set CREATED
50-
run: echo "CREATED=$(date --rfc-3339=seconds)" >> $GITHUB_ENV
40+
- name: 'Copy distribution'
41+
run: cp ./connect-file-pulse-plugin/target/components/packages/streamthoughts-kafka-connect-file-pulse-${{ env.VERSION }}.zip ./docker/ \
5142

52-
- name: Login to DockerHub
43+
- name: 'Login to DockerHub'
5344
uses: docker/login-action@v2
5445
with:
5546
username: ${{ secrets.DOCKERHUB_USERNAME }}
5647
password: ${{ secrets.DOCKERHUB_TOKEN }}
5748

58-
- name: Push to Docker Hub
59-
uses: docker/build-push-action@v3
49+
- name: 'Build & Push to Docker Hub'
50+
uses: docker/build-push-action@v4
6051
with:
6152
context: ./docker
53+
platforms: linux/amd64,linux/arm64
6254
file: ./docker/Dockerfile
6355
no-cache: true
6456
push: true
6557
tags: streamthoughts/kafka-connect-file-pulse:master
6658
build-args: |
67-
VERSION=${{ env.PROJECT_VERSION }}
59+
VERSION=${{ env.VERSION }}
6860
COMMIT=${{ env.GIT_COMMIT }}
6961
BRANCH=${{ env.GIT_BRANCH }}
7062
CREATED=${{ env.CREATED }}

.github/workflows/early-access.yml

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Copyright 2023 The original authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
name: Early Access
16+
17+
on:
18+
push:
19+
branches: [ master ]
20+
21+
env:
22+
JAVA_VERSION: '11'
23+
JAVA_DISTRO: 'zulu'
24+
25+
jobs:
26+
build-distribution:
27+
if: github.repository == 'streamthoughts/kafka-connect-file-pulse'
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: 'Checkout GitHub repository'
31+
uses: actions/checkout@v4
32+
with:
33+
ref: ${{ needs.set-release-version.outputs.HEAD }}
34+
fetch-depth: 0
35+
clean: true
36+
37+
- name: 'Set up Java'
38+
uses: actions/setup-java@v3
39+
with:
40+
java-version: ${{ env.JAVA_VERSION }}
41+
distribution: ${{ env.JAVA_DISTRO }}
42+
cache: 'maven'
43+
44+
- name: 'Build Distribution'
45+
run: |
46+
./mvnw -ntp -B --file pom.xml -Pall,dist package
47+
48+
- name: 'Upload build artifact'
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: artifacts
52+
path: |
53+
connect-file-pulse-plugin/target/components/packages/*.zip
54+
55+
release-artifacts:
56+
needs: [ build-distribution ]
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: 'Checkout GitHub repository'
60+
uses: actions/checkout@v4
61+
with:
62+
ref: ${{ needs.set-release-version.outputs.HEAD }}
63+
fetch-depth: 0
64+
65+
- name: 'Download all artifacts'
66+
uses: actions/download-artifact@v3
67+
68+
- name: 'Set up Java'
69+
uses: actions/setup-java@v3
70+
with:
71+
java-version: ${{ env.JAVA_VERSION }}
72+
distribution: ${{ env.JAVA_DISTRO }}
73+
74+
- name: 'Cache Maven packages'
75+
uses: actions/[email protected]
76+
with:
77+
path: ~/.m2
78+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
79+
restore-keys: ${{ runner.os }}-m2
80+
81+
- name: 'Configure Git'
82+
run: |
83+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
84+
git config --global user.name "github-actions[bot]"
85+
86+
- name: 'Release with JReleaser'
87+
env:
88+
JRELEASER_GITHUB_TOKEN: ${{ secrets.PAT }}
89+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
90+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
91+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
92+
run: ./mvnw -ntp -B --file ./pom.xml -Prelease -DartifactsDir=artifacts jreleaser:full-release
93+
94+
- name: 'JReleaser output'
95+
if: always()
96+
uses: actions/upload-artifact@v3
97+
with:
98+
name: jreleaser-logs
99+
path: |
100+
target/jreleaser/trace.log
101+
target/jreleaser/output.properties

.github/workflows/feature.yml

+11-7
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,26 @@ on:
44
pull_request:
55
types: [opened, synchronize, reopened]
66

7+
env:
8+
JAVA_VERSION: '11'
9+
JAVA_DISTRO: 'zulu'
10+
711
jobs:
812
build:
913
runs-on: ubuntu-latest
1014
steps:
1115
- uses: actions/checkout@v3
1216
with:
1317
fetch-depth: 0
14-
15-
- name: Grant execute permission for gradlew
16-
run: chmod +x ./mvnw
1718

18-
- name: Set up JDK 11
19+
- name: 'Set up Java'
1920
uses: actions/setup-java@v3
2021
with:
21-
distribution: 'zulu' # same as in Confluent image
22-
java-version: 11
22+
java-version: ${{ env.JAVA_VERSION }}
23+
distribution: ${{ env.JAVA_DISTRO }}
2324
cache: 'maven'
25+
2426
- name: Build with Maven
25-
run: ./mvnw -B verify --file pom.xml
27+
run: |
28+
chmod +x ./mvnw
29+
./mvnw -ntp -B verify --file pom.xml

.github/workflows/main.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ name: Main Build
22

33
on:
44
push:
5-
branches:
6-
- master
5+
branches: [ master ]
6+
7+
env:
8+
JAVA_VERSION: '11'
9+
JAVA_DISTRO: 'zulu'
710

811
jobs:
912
build:
@@ -12,31 +15,28 @@ jobs:
1215
- uses: actions/checkout@v3
1316
with:
1417
fetch-depth: 0
15-
16-
- name: Grant execute permission for gradlew
17-
run: chmod +x ./mvnw
1818

19-
- name: Set up JDK 11
19+
- name: 'Set up Java'
2020
uses: actions/setup-java@v3
2121
with:
22-
distribution: 'zulu' # same as in Confluent image
23-
java-version: 11
22+
java-version: ${{ env.JAVA_VERSION }}
23+
distribution: ${{ env.JAVA_DISTRO }}
2424
cache: 'maven'
25-
- name: Build with Maven
26-
run: ./mvnw -B verify --file pom.xml
2725

28-
- name: Cache SonarCloud packages
26+
- name: 'Build with Maven'
27+
run: |
28+
chmod +x ./mvnw
29+
./mvnw -ntp -B verify --file pom.xml
30+
31+
- name: 'Cache SonarCloud packages'
2932
uses: actions/cache@v3
3033
with:
3134
path: ~/.sonar/cache
3235
key: ${{ runner.os }}-sonar
3336
restore-keys: ${{ runner.os }}-sonar
3437

35-
- name: Grant execute permission for gradlew
36-
run: chmod +x ./mvnw
37-
38-
- name: Build and analyze
38+
- name: 'Build and analyze'
3939
env:
4040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
4141
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
42-
run: ./mvnw -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=streamthoughts_kafka-connect-file-pulse
42+
run: ./mvnw -ntp -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=streamthoughts_kafka-connect-file-pulse

Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ print-info:
4444

4545
build-dist: print-info
4646
if [[ ! -z "$$MVN_PROFILE" ]]; then \
47-
./mvnw clean package -B -q -Dmaven.test.skip=true -P $$MVN_PROFILE; \
47+
./mvnw clean package -B -q -DskipTests -P dist,$$MVN_PROFILE; \
4848
else \
49-
./mvnw clean package -B -q -Dmaven.test.skip=true; \
49+
./mvnw clean package -B -q -DskipTests -P dist,all; \
5050
fi
5151

5252
docker-build: build-dist
@@ -81,3 +81,6 @@ push-images: print-info
8181
for PROFILE in $(PROFILES); do\
8282
docker push ${REPOSITORY}/${IMAGE}:${VERSION}-$$PROFILE || exit 1 ;\
8383
done
84+
85+
changelog:
86+
./mvnw jreleaser:changelog -Prelease --file pom.xml

connect-file-pulse-api/pom.xml

+13-30
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
~ Copyright 2019-2020 StreamThoughts.
4-
~
5-
~ Licensed to the Apache Software Foundation (ASF) under one or more
6-
~ contributor license agreements. See the NOTICE file distributed with
7-
~ this work for additional information regarding copyright ownership.
8-
~ The ASF licenses this file to You under the Apache License, Version 2.0
9-
~ (the "License"); you may not use this file except in compliance with
10-
~ the License. You may obtain a copy of the License at
11-
~
12-
~ http://www.apache.org/licenses/LICENSE-2.0
13-
~
14-
~ Unless required by applicable law or agreed to in writing, software
15-
~ distributed under the License is distributed on an "AS IS" BASIS,
16-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
~ See the License for the specific language governing permissions and
18-
~ limitations under the License.
19-
-->
3+
Copyright 2023 StreamThoughts
204
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
2117
<project xmlns="http://maven.apache.org/POM/4.0.0"
2218
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2319
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -32,19 +28,6 @@
3228
<artifactId>kafka-connect-filepulse-api</artifactId>
3329

3430
<name>Kafka Connect Source File Pulse APIs</name>
35-
<description>Connect File Pulse is a multi-purpose source connector for streaming files from a local filesystem to Kafka.</description>
36-
37-
<organization>
38-
<name>streamthoughts</name>
39-
<url>http://streamthoughts.io</url>
40-
</organization>
41-
42-
<licenses>
43-
<license>
44-
<name>The Apache Software License, Version 2.0</name>
45-
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
46-
</license>
47-
</licenses>
4831

4932
<properties>
5033
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

connect-file-pulse-dataformat/pom.xml

+15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2023 StreamThoughts
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
217
<project xmlns="http://maven.apache.org/POM/4.0.0"
318
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
419
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

0 commit comments

Comments
 (0)