Skip to content

Commit

Permalink
Merge pull request #732 from zhicwu/update-build-config
Browse files Browse the repository at this point in the history
Update build config for repackaging 3rd party libs
  • Loading branch information
zhicwu authored Oct 6, 2021
2 parents ec0388c + adc6525 commit 34ada5f
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: |
find . -type f -name "pom.xml" -exec sed -i -e 's|${revision}|${{ steps.version.outputs.value }}|g' \
-e 's|^\( <version>\).*\(</version>\)$|\1${{ steps.version.outputs.value }}\2|' \
-e 's|${parent.groupId}|tech.clickhouse|g' -e 's|.*argLine.*timezone=.*||g' '{}' \;
-e 's|${parent.groupId}|com.clickhouse|g' '{}' \;
find . -type f -name "log4j.*" -exec rm -fv '{}' \;
- name: Build project
run: |
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
run: |
find . -type f -name "pom.xml" -exec sed -i -e 's|${revision}|${{ github.event.inputs.version }}|g' \
-e 's|^\( <version>\).*\(</version>\)$|\1${{ github.event.inputs.driver }}\2|' \
-e 's|${parent.groupId}|tech.clickhouse|g' -e 's|.*argLine.*timezone=.*||g' '{}' \;
-e 's|${parent.groupId}|com.clickhouse|g' '{}' \;
find . -type f -name "log4j.*" -exec rm -fv '{}' \;
continue-on-error: true
- name: Install driver as needed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
find . -type f -name "pom.xml" -exec sed -i -e 's|${revision}|${{ github.event.inputs.version }}|g' \
-e 's|^\( <version>\).*\(</version>\)$|\1${{ github.event.inputs.version }}\2|' \
-e 's|${parent.groupId}|tech.clickhouse|g' -e 's|.*argLine.*timezone=.*||g' '{}' \;
-e 's|${parent.groupId}|com.clickhouse|g' '{}' \;
find . -type f -name "log4j.*" -exec rm -fv '{}' \;
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/release_3rd_party_libs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: "Release version"
required: true
default: "1.0.0"

jobs:
release:
name: "Build and Publish Repackaged 3rd Party Libraries"
runs-on: "ubuntu-latest"

steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Java and Maven
uses: actions/setup-java@v1
with:
java-version: 9
- name: Update pom files and reduce logs
run: |
find . -type f -name "pom.xml" -exec sed -i -e 's|${revision}|${{ github.event.inputs.version }}|g' \
-e 's|^\( <version>\).*\(</version>\)$|\1${{ github.event.inputs.version }}\2|' \
-e 's|${parent.groupId}|com.clickhouse|g' '{}' \;
find . -type f -name "log4j.*" -exec rm -fv '{}' \;
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
directory: third-party-libraries
maven_profiles: release
maven_args: -q --batch-mode
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.SONATYPE_USER }}
nexus_password: ${{ secrets.SONATYPE_PASSWD }}
1 change: 0 additions & 1 deletion .github/workflows/timezone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ jobs:
${{ runner.os }}-build-
- name: Test using Maven
run: |
find . -type f -name "pom.xml" -exec sed -i -e 's|.*argLine.*timezone=.*||g' '{}' \;
mvn --batch-mode --update-snapshots \
-DclickhouseTimezone=${{ matrix.serverTz }} \
-DclickhouseVersion=21.8 \
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ jobs:
- name: Verify with Maven
if: steps.check.outputs.triggered == 'true'
run: |
find . -type f -name "pom.xml" -exec sed -i -e 's|.*argLine.*timezone=.*||g' '{}' \;
mvn --batch-mode --update-snapshots \
-DclickhouseVersion=${{ fromJSON(steps.commented.outputs.result).clickhouse }} \
-DclickhouseTimezone=Asia/Chongqing \
Expand Down Expand Up @@ -129,7 +128,6 @@ jobs:
continue-on-error: true
- name: Verify with Maven
run: |
find . -type f -name "pom.xml" -exec sed -i -e 's|.*argLine.*timezone=.*||g' '{}' \;
mvn --batch-mode --update-snapshots \
-DclickhouseVersion=${{ github.event.inputs.clickhouse }} \
-DclickhouseTimezone=${{ github.event.inputs.chTz }} \
Expand Down
28 changes: 7 additions & 21 deletions third-party-libraries/io.grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,18 @@
<parent>
<groupId>com.clickhouse</groupId>
<artifactId>third-party-libraries</artifactId>
<version>1.0.0</version>
<version>${revision}</version>
</parent>

<artifactId>io.grpc</artifactId>
<version>${grpc.version}</version>
<name>Repackaged grpc-java for JPMS support</name>
<description>A Java modules compatible re-packaging of grpc-java</description>
<version>${revision}</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
<description>Repackaged grpc-java for JPMS support</description>
<url>https://github.com/ClickHouse/clickhouse-jdbc/tree/master/third-party-libraries/io.grpc</url>

<dependencies>
<!--
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
-->
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-api</artifactId>
Expand Down Expand Up @@ -72,7 +69,6 @@

<build>
<plugins>
<!-- create the base JAR removing all of the dummy classes -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand All @@ -82,8 +78,6 @@
</excludes>
</configuration>
</plugin>

<!-- create the shaded JAR -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down Expand Up @@ -114,14 +108,6 @@
</excludes>
</filter>
</filters>
<!-- artifactSet>
<includes>
<include>io.grpc:*</include>
<include>com.google.instrumentation:instrumentation-api</include>
<include>io.opencensus:opencensus-api</include>
<include>io.opencensus:opencensus-contrib-grpc-metrics</include>
</includes>
</artifactSet -->
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
Expand Down
6 changes: 3 additions & 3 deletions third-party-libraries/org.roaringbitmap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<parent>
<groupId>com.clickhouse</groupId>
<artifactId>third-party-libraries</artifactId>
<version>1.0.0</version>
<version>${revision}</version>
</parent>

<artifactId>org.roaringbitmap</artifactId>
<version>${roaring-bitmap.version}</version>
<version>${revision}</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
<description>Repackaged RoaringBitmap for JPMS compatibility</description>
<description>Repackaged RoaringBitmap for JPMS support</description>
<url>https://github.com/ClickHouse/clickhouse-jdbc/tree/master/third-party-libraries/org.roaringbitmap</url>

<dependencies>
Expand Down
21 changes: 20 additions & 1 deletion third-party-libraries/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.clickhouse</groupId>
<artifactId>third-party-libraries</artifactId>
<version>1.0.0</version>
<version>${revision}</version>
<packaging>pom</packaging>

<name>${project.artifactId}</name>
Expand Down Expand Up @@ -68,6 +68,7 @@
</distributionManagement>

<properties>
<revision>1.0.0</revision>
<project.current.year>2021</project.current.year>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand All @@ -85,6 +86,7 @@
<shade-plugin.version>3.2.4</shade-plugin.version>
<source-plugin.version>3.2.1</source-plugin.version>
<jar-plugin.version>3.2.0</jar-plugin.version>
<javadoc-plugin.version>3.2.0</javadoc-plugin.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -188,6 +190,11 @@
<artifactId>maven-jar-plugin</artifactId>
<version>${jar-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down Expand Up @@ -260,6 +267,18 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand Down

0 comments on commit 34ada5f

Please sign in to comment.