Skip to content

Commit

Permalink
DBZ-8604 Add assembly profile to build dist package
Browse files Browse the repository at this point in the history
  • Loading branch information
mfvitale committed Jan 28, 2025
1 parent c9930cc commit 0798f71
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 6 deletions.
58 changes: 54 additions & 4 deletions .github/workflows/conductor-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,58 @@ on:
branches:
- main
jobs:
build_cache:
name: "Update Dependencies"
runs-on: ubuntu-latest
defaults:
run:
working-directory: debezium-platform-conductor
steps:
- name: Checkout core repository
uses: actions/checkout@v4
with:
repository: debezium/debezium
ref: main
path: core
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
# GitHub actions seem to struggle returning actions/cache cache-hit
# Directly use the cache action here to control whether to fetch dependencies
- id: maven-cache-check
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}
# Caches should be restored based on a logical order to minimize the build and test
# execution time. Here the logic is as follows:
# 1. Restore this PR's cache if the PR has previously been built
# 2. Restore the latest main cache if the core pom has not changed
# 3. Restore the latest main cache available
# This should minimize the download time required for updating dependencies
restore-keys: |
maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}
maven-debezium-test-push-build-${{ hashFiles('core/**/pom.xml') }}
maven-debezium-test-push-build-
- name: Maven build core dependencies
run: >
mvnw clean install -f pom.xml
-DskipTests
-DskipITs
-Dformat.formatter.goal=validate
-Dformat.imports.goal=check
-Dhttp.keepAlive=false
-Dmaven.wagon.http.pool=false
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
-Dmaven.javadoc.skip=true
-Dstyle.color=always
--no-transfer-progress
-T4
check_style:
name: "Checkstyle and Formatting"
needs: [ build_cache ]
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -32,8 +82,8 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-debezium-platform-test-build-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-debezium-platform-test-build-${{ hashFiles('**/pom.xml') }}
key: maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}
restore-keys: maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}

- name: "Checkstyle, Formatting, and Import Order Checks"
run: >
Expand Down Expand Up @@ -64,8 +114,8 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-debezium-platform-test-build-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-debezium-platform-test-build-${{ hashFiles('**/pom.xml') }}
key: maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}
restore-keys: maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}

- name: Run tests
run: ./mvnw clean verify
33 changes: 33 additions & 0 deletions debezium-platform-conductor/dist/assembly/conductor.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 https://maven.apache.org/xsd/assembly-2.2.0.xsd">
<id>distribution</id>
<formats>
<format>tar.gz</format>
<format>zip</format>
</formats>

<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<!-- Get the files from the top-level directory -->
<directory>${dist.root.dir}</directory>
<outputDirectory>${project.artifactId}</outputDirectory>
<includes>
<include>README*</include>
<include>CHANGELOG*</include>
<include>CONTRIBUTE*</include>
<include>COPYRIGHT*</include>
<include>LICENSE*</include>
</includes>
<useDefaultExcludes>true</useDefaultExcludes>
</fileSet>
<fileSet>
<directory>${dist.app.source.dir}</directory>
<outputDirectory>${project.artifactId}</outputDirectory>
<includes>
<include>**/**</include>
</includes>
</fileSet>
</fileSets>
</assembly>
48 changes: 46 additions & 2 deletions debezium-platform-conductor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>io.debezium</groupId>

<parent>
<groupId>io.debezium</groupId>
<artifactId>debezium-parent</artifactId>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>debezium-platform-conductor</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>

<properties>
<compiler-plugin.version>3.12.1</compiler-plugin.version>
<maven.compiler.release>21</maven.compiler.release>
Expand Down Expand Up @@ -35,6 +42,10 @@
<!-- Do not skip formatting source code by default -->
<format.skip>false</format.skip>

<!-- Distribution -->
<dist.root.dir>${project.basedir}</dist.root.dir>
<dist.app.source.dir>${dist.root.dir}/target/quarkus-app</dist.app.source.dir>

</properties>
<dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -361,6 +372,8 @@
</plugin>
</plugins>
</build>


<profiles>
<profile>
<id>native</id>
Expand All @@ -374,5 +387,36 @@
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
<profile>
<id>assembly</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${version.assembly.plugin}</version>
<configuration>
<attach>true</attach> <!-- we want to attach & deploy these to Maven -->
<tarLongFileMode>posix</tarLongFileMode>
</configuration>
<executions>
<execution>
<id>operator-package</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>dist/assembly/conductor.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 0798f71

Please sign in to comment.