Skip to content

Commit d79d56e

Browse files
authored
Merge pull request #31 from ShawnChen-Sirius/v1/release-engineering
Publish RCs through GitHub Packages
2 parents edfb4fe + 68b66f5 commit d79d56e

18 files changed

Lines changed: 294 additions & 144 deletions

File tree

‎.github/workflows/rc-release.yml‎

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
name: Maven RC release
2+
3+
# RCs are published to GitHub Packages while Maven Central Publisher Pro is being arranged.
4+
# The permanent Maven coordinates are used from the first RC, so the later Central migration
5+
# changes only the repository URL, not users' dependencies.
6+
on:
7+
push:
8+
tags:
9+
- 'v*-rc.*'
10+
workflow_dispatch:
11+
inputs:
12+
tag:
13+
description: Existing RC tag to build and publish
14+
required: true
15+
type: string
16+
17+
concurrency:
18+
group: rc-release-${{ inputs.tag || github.ref_name }}
19+
cancel-in-progress: false
20+
21+
permissions:
22+
contents: read
23+
actions: read
24+
25+
env:
26+
MAVEN_ARGS: '--batch-mode --no-transfer-progress'
27+
28+
jobs:
29+
build:
30+
name: build ${{ matrix.platform }}
31+
runs-on: ${{ matrix.runner }}
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include:
36+
- platform: linux-x86_64-gnu
37+
runner: ubuntu-22.04
38+
- platform: linux-aarch64-gnu
39+
runner: ubuntu-22.04-arm
40+
- platform: macos-aarch64
41+
runner: macos-15
42+
- platform: macos-x86_64
43+
runner: macos-15-intel
44+
steps:
45+
- uses: actions/checkout@v4
46+
with:
47+
ref: ${{ inputs.tag || github.ref }}
48+
49+
- uses: actions/setup-java@v4
50+
with:
51+
distribution: temurin
52+
java-version: '11'
53+
cache: maven
54+
55+
- name: Resolve and validate RC version
56+
run: |
57+
set -eu
58+
TAG='${{ inputs.tag || github.ref_name }}'
59+
case "$TAG" in
60+
v*-rc.*) ;;
61+
*) echo "Expected a tag like v1.0.0-rc.1, got $TAG" >&2; exit 1 ;;
62+
esac
63+
VERSION="${TAG#v}"
64+
echo "RC_TAG=$TAG" >> "$GITHUB_ENV"
65+
echo "RC_VERSION=$VERSION" >> "$GITHUB_ENV"
66+
67+
- name: Set the Maven RC version
68+
run: |
69+
# shellcheck disable=SC2086
70+
mvn $MAVEN_ARGS org.codehaus.mojo:versions-maven-plugin:2.17.0:set \
71+
-DnewVersion="$RC_VERSION" -DgenerateBackupPoms=false
72+
73+
- name: Compile and run unit tests
74+
run: |
75+
# shellcheck disable=SC2086
76+
mvn $MAVEN_ARGS -pl chdb-jdbc -am test
77+
78+
- name: Fetch the engine and build the native shim
79+
run: |
80+
case '${{ matrix.platform }}' in
81+
linux-*) scripts/build-native-in-container.sh '${{ matrix.platform }}' ;;
82+
*) scripts/build-native.sh '${{ matrix.platform }}' ;;
83+
esac
84+
85+
- name: Package the JDBC and native artifacts
86+
run: |
87+
set -eu
88+
# shellcheck disable=SC2086
89+
mvn $MAVEN_ARGS -pl chdb-jdbc,chdb-native-${{ matrix.platform }} package -DskipTests
90+
mkdir -p "maven/${{ matrix.platform }}"
91+
cp "chdb-jdbc/target/chdb-jdbc-${RC_VERSION}.jar" "maven/${{ matrix.platform }}/"
92+
cp "chdb-native-${{ matrix.platform }}/target/chdb-native-${{ matrix.platform }}-${RC_VERSION}.jar" "maven/${{ matrix.platform }}/"
93+
cp pom.xml "maven/${{ matrix.platform }}/chdb-java-parent.pom"
94+
cp chdb-jdbc/pom.xml "maven/${{ matrix.platform }}/chdb-jdbc.pom"
95+
cp "chdb-native-${{ matrix.platform }}/pom.xml" "maven/${{ matrix.platform }}/chdb-native-${{ matrix.platform }}.pom"
96+
cp chdb-bom/pom.xml "maven/${{ matrix.platform }}/chdb-bom.pom"
97+
98+
- uses: actions/upload-artifact@v4
99+
with:
100+
name: maven-${{ matrix.platform }}
101+
path: maven/${{ matrix.platform }}
102+
if-no-files-found: error
103+
retention-days: 14
104+
105+
publish:
106+
name: publish RC to GitHub Packages
107+
needs: build
108+
runs-on: ubuntu-latest
109+
permissions:
110+
contents: read
111+
packages: write
112+
steps:
113+
- uses: actions/checkout@v4
114+
with:
115+
ref: ${{ inputs.tag || github.ref }}
116+
117+
- uses: actions/setup-java@v4
118+
with:
119+
distribution: temurin
120+
java-version: '11'
121+
server-id: github
122+
server-username: GITHUB_ACTOR
123+
server-password: GITHUB_TOKEN
124+
125+
- name: Resolve RC version
126+
run: |
127+
TAG='${{ inputs.tag || github.ref_name }}'
128+
case "$TAG" in
129+
v*-rc.*) ;;
130+
*) echo "Expected a tag like v1.0.0-rc.1, got $TAG" >&2; exit 1 ;;
131+
esac
132+
echo "RC_VERSION=${TAG#v}" >> "$GITHUB_ENV"
133+
134+
- uses: actions/download-artifact@v4
135+
with:
136+
pattern: maven-*
137+
path: maven
138+
139+
- name: Publish Maven artifacts
140+
env:
141+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142+
GITHUB_ACTOR: ${{ github.actor }}
143+
run: |
144+
set -eu
145+
REPOSITORY_URL="https://maven.pkg.github.com/${GITHUB_REPOSITORY_OWNER,,}/chdb-java"
146+
PARENT_POM=$(find maven -name chdb-java-parent.pom -print -quit)
147+
JDBC_POM=$(find maven -name chdb-jdbc.pom -print -quit)
148+
BOM_POM=$(find maven -name chdb-bom.pom -print -quit)
149+
150+
mvn $MAVEN_ARGS org.apache.maven.plugins:maven-deploy-plugin:3.1.3:deploy-file \
151+
-Dfile="$PARENT_POM" -DgroupId=com.clickhouse.chdb -DartifactId=chdb-java-parent \
152+
-Dversion="$RC_VERSION" -Dpackaging=pom -DgeneratePom=false \
153+
-DrepositoryId=github -Durl="$REPOSITORY_URL"
154+
155+
mvn $MAVEN_ARGS org.apache.maven.plugins:maven-deploy-plugin:3.1.3:deploy-file \
156+
-Dfile="$(find maven -name "chdb-jdbc-${RC_VERSION}.jar" -print -quit)" \
157+
-DpomFile="$JDBC_POM" -DgeneratePom=false \
158+
-DrepositoryId=github -Durl="$REPOSITORY_URL"
159+
160+
for platform in macos-aarch64 macos-x86_64 linux-x86_64-gnu linux-aarch64-gnu; do
161+
NATIVE_POM=$(find maven -name "chdb-native-${platform}.pom" -print -quit)
162+
NATIVE_JAR=$(find maven -name "chdb-native-${platform}-${RC_VERSION}.jar" -print -quit)
163+
mvn $MAVEN_ARGS org.apache.maven.plugins:maven-deploy-plugin:3.1.3:deploy-file \
164+
-Dfile="$NATIVE_JAR" -DpomFile="$NATIVE_POM" -DgeneratePom=false \
165+
-DrepositoryId=github -Durl="$REPOSITORY_URL"
166+
done
167+
168+
mvn $MAVEN_ARGS org.apache.maven.plugins:maven-deploy-plugin:3.1.3:deploy-file \
169+
-Dfile="$BOM_POM" -DpomFile="$BOM_POM" -Dpackaging=pom \
170+
-DgroupId=com.clickhouse.chdb -DartifactId=chdb-bom -Dversion="$RC_VERSION" \
171+
-DgeneratePom=false \
172+
-DrepositoryId=github -Durl="$REPOSITORY_URL"

‎CHDB_JAVA_V1_WORK_PLAN.md‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ What "multiple ClassLoaders" means in V1: several child ClassLoaders can share o
165165
### 4.1 V1 artifacts
166166

167167
```text
168-
org.chdb:chdb-jdbc:<version>
169-
org.chdb:chdb-native-linux-x86_64-gnu:<version>
170-
org.chdb:chdb-native-linux-aarch64-gnu:<version>
171-
org.chdb:chdb-native-macos-x86_64:<version>
172-
org.chdb:chdb-native-macos-aarch64:<version>
173-
org.chdb:chdb-bom:<version>
168+
com.clickhouse.chdb:chdb-jdbc:<version>
169+
com.clickhouse.chdb:chdb-native-linux-x86_64-gnu:<version>
170+
com.clickhouse.chdb:chdb-native-linux-aarch64-gnu:<version>
171+
com.clickhouse.chdb:chdb-native-macos-x86_64:<version>
172+
com.clickhouse.chdb:chdb-native-macos-aarch64:<version>
173+
com.clickhouse.chdb:chdb-bom:<version>
174174
```
175175

176176
- `chdb-jdbc`: the pure Java API, the JDBC implementation and the native loader. It does not contain the chDB engine.
@@ -219,16 +219,17 @@ a break in the Java API could ship as a trailing `.2`.
219219
| Fix in the driver, loader or JNI shim | `1.0.1` |
220220
| New engine baseline, no Java API change | `1.1.0` |
221221
| Breaking change to the Java API | `2.0.0` |
222-
| Preview of `1.0.0` | `1.0.0-preview.1` |
222+
| First Maven RC / first test version | `1.0.0-rc.1` |
223223

224224
Release rules:
225225

226226
- A published artifact is immutable. Never overwrite `1.0.0`; any fix ships as `1.0.1`.
227227
- `chdb-jdbc`, the four platform packages and `chdb-bom` always carry the same version.
228228
- An engine change is a `MINOR` bump when it changes what the driver can do and a `PATCH` when it does not. It is never invisible: the manifest and the release notes name the engine.
229-
- A binding built on an engine RC is a preview and cannot be V1 GA.
229+
- A binding built on an engine RC is an RC and cannot be V1 GA.
230230
- `-SNAPSHOT` is for development and never reaches Maven Central.
231-
- **`-preview.<n>` sorts *above* the release it previews.** Maven's `ComparableVersion` orders unknown qualifiers after the final release, so `1.0.0-preview.1` compares newer than `1.0.0` — measured, not assumed. It costs nothing here because previews are installed by hand into a local repository and never published beside a GA, and consumers name exact versions. If a preview ever has to live in a shared repository, use `-rc.<n>`, which Maven does order below the release.
231+
- **`-rc.<n>` is the shared-repository pre-release qualifier.** The first test version is
232+
`1.0.0-rc.1`, followed by `1.0.0-rc.2` and then the stable `1.0.0` release.
232233

233234
To remove string-parsing ambiguity, every artifact manifest records these separately:
234235

‎README.md‎

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ A JDBC driver for [chDB](https://github.com/chdb-io/chdb-core), the embedded bui
44
ClickHouse. It runs the engine in your JVM's process — no server, no network — and gives you
55
streaming, forward-only result sets over ClickHouse SQL.
66

7-
> **Status: pre-release.** V1 is under construction against the work plan in
8-
> [`CHDB_JAVA_V1_WORK_PLAN.md`](CHDB_JAVA_V1_WORK_PLAN.md). Nothing is on Maven Central yet
9-
> and the public API is not frozen; releases ship as
10-
> [preview bundles](#a-preview-from-a-github-release). See
7+
> **Status: release candidate.** The first Maven release candidate is `v1.0.0-rc.1`, built with
8+
> chDB Core `26.7.3`. RC artifacts are published to GitHub Packages until Maven Central is ready;
9+
> the public API is not frozen. See
1110
> [What works today](#what-works-today).
1211
1312
```java
@@ -58,35 +57,34 @@ on. The native package pulls in the driver, so declaring it alone is enough.
5857

5958
```xml
6059
<dependency>
61-
<groupId>org.chdb</groupId>
60+
<groupId>com.clickhouse.chdb</groupId>
6261
<artifactId>chdb-native-linux-x86_64-gnu</artifactId>
63-
<version>1.0.0</version>
62+
<version>1.0.0-rc.1</version>
6463
</dependency>
6564
```
6665

67-
**These coordinates do not resolve yet, and `org.chdb` is provisional** — nothing is on Maven
68-
Central, and the published group id may end up being `com.clickhouse`. See
69-
[docs/release-readiness.md](docs/release-readiness.md). Until then, install a preview.
66+
GitHub Packages requires a GitHub classic PAT with `read:packages` in `~/.m2/settings.xml`:
7067

71-
### A preview from a GitHub Release
72-
73-
Previews ship as one zip per platform, holding the same artifacts a Central release would:
74-
75-
```bash
76-
curl -fsSL -o /tmp/install-chdb-java-preview.sh \
77-
https://raw.githubusercontent.com/chdb-io/chdb-java/main/scripts/install-preview.sh
78-
chmod +x /tmp/install-chdb-java-preview.sh
79-
/tmp/install-chdb-java-preview.sh v1.0.0-preview.1
68+
```xml
69+
<settings>
70+
<servers>
71+
<server>
72+
<id>github</id>
73+
<username>YOUR_GITHUB_USERNAME</username>
74+
<password>YOUR_GITHUB_PAT</password>
75+
</server>
76+
</servers>
77+
</settings>
8078
```
8179

82-
It downloads the bundle for this platform, verifies it against the release's `SHA256SUMS`,
83-
installs it with `mvn install-file`, and prints the coordinates. Use `--maven-repo PATH` for a
84-
repository other than `~/.m2/repository`. Then declare the dependency as above with
85-
`1.0.0-preview.1`; because the bundle carries its own POMs, a later change of group id does
86-
not strand an installed preview.
80+
Add the repository to the consuming project:
8781

88-
Each preview tag is a commit on `main`, built and tested on all four platforms by
89-
[`preview-release.yml`](.github/workflows/preview-release.yml).
82+
```xml
83+
<repository>
84+
<id>github</id>
85+
<url>https://maven.pkg.github.com/chdb-io/chdb-java</url>
86+
</repository>
87+
```
9088

9189
Building for several platforms — a CI matrix, or a distribution your users install on either
9290
architecture — declare the driver plus each native package you need:
@@ -95,7 +93,7 @@ architecture — declare the driver plus each native package you need:
9593
<dependencyManagement>
9694
<dependencies>
9795
<dependency>
98-
<groupId>org.chdb</groupId>
96+
<groupId>com.clickhouse.chdb</groupId>
9997
<artifactId>chdb-bom</artifactId>
10098
<version>1.0.0</version>
10199
<type>pom</type>
@@ -106,15 +104,15 @@ architecture — declare the driver plus each native package you need:
106104

107105
<dependencies>
108106
<dependency>
109-
<groupId>org.chdb</groupId>
107+
<groupId>com.clickhouse.chdb</groupId>
110108
<artifactId>chdb-jdbc</artifactId>
111109
</dependency>
112110
<dependency>
113-
<groupId>org.chdb</groupId>
111+
<groupId>com.clickhouse.chdb</groupId>
114112
<artifactId>chdb-native-linux-x86_64-gnu</artifactId>
115113
</dependency>
116114
<dependency>
117-
<groupId>org.chdb</groupId>
115+
<groupId>com.clickhouse.chdb</groupId>
118116
<artifactId>chdb-native-macos-aarch64</artifactId>
119117
</dependency>
120118
</dependencies>
@@ -134,9 +132,9 @@ change to the Java API. The engine version is not part of it — it is in each p
134132
named in the release notes (`26.7.3` today), and the driver refuses to load any other build.
135133
See [work plan §4.3](CHDB_JAVA_V1_WORK_PLAN.md).
136134

137-
A preview is that version with a `-preview.<n>` qualifier. Maven orders an unknown qualifier
138-
*after* the release, so `1.0.0-preview.1` compares newer than `1.0.0`: name the version you
139-
want rather than a range, and note that previews are never published beside a GA.
135+
The first test version is the RC `1.0.0-rc.1`; later candidates increment the final number, and
136+
the first stable Maven release is `1.0.0`. RCs use the permanent `com.clickhouse.chdb` groupId,
137+
so moving stable releases to Maven Central will not change dependency coordinates.
140138

141139
## Connecting
142140

‎chdb-bom/pom.xml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<parent>
8-
<groupId>org.chdb</groupId>
8+
<groupId>com.clickhouse.chdb</groupId>
99
<artifactId>chdb-java-parent</artifactId>
10-
<version>1.0.0-preview.1</version>
10+
<version>1.0.0-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>chdb-bom</artifactId>
@@ -23,27 +23,27 @@
2323
<dependencyManagement>
2424
<dependencies>
2525
<dependency>
26-
<groupId>org.chdb</groupId>
26+
<groupId>com.clickhouse.chdb</groupId>
2727
<artifactId>chdb-jdbc</artifactId>
2828
<version>${project.version}</version>
2929
</dependency>
3030
<dependency>
31-
<groupId>org.chdb</groupId>
31+
<groupId>com.clickhouse.chdb</groupId>
3232
<artifactId>chdb-native-macos-aarch64</artifactId>
3333
<version>${project.version}</version>
3434
</dependency>
3535
<dependency>
36-
<groupId>org.chdb</groupId>
36+
<groupId>com.clickhouse.chdb</groupId>
3737
<artifactId>chdb-native-macos-x86_64</artifactId>
3838
<version>${project.version}</version>
3939
</dependency>
4040
<dependency>
41-
<groupId>org.chdb</groupId>
41+
<groupId>com.clickhouse.chdb</groupId>
4242
<artifactId>chdb-native-linux-x86_64-gnu</artifactId>
4343
<version>${project.version}</version>
4444
</dependency>
4545
<dependency>
46-
<groupId>org.chdb</groupId>
46+
<groupId>com.clickhouse.chdb</groupId>
4747
<artifactId>chdb-native-linux-aarch64-gnu</artifactId>
4848
<version>${project.version}</version>
4949
</dependency>

‎chdb-examples/pom.xml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<parent>
8-
<groupId>org.chdb</groupId>
8+
<groupId>com.clickhouse.chdb</groupId>
99
<artifactId>chdb-java-parent</artifactId>
10-
<version>1.0.0-preview.1</version>
10+
<version>1.0.0-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>chdb-examples</artifactId>
@@ -21,7 +21,7 @@
2121

2222
<dependencies>
2323
<dependency>
24-
<groupId>org.chdb</groupId>
24+
<groupId>com.clickhouse.chdb</groupId>
2525
<artifactId>chdb-jdbc</artifactId>
2626
<version>${project.version}</version>
2727
</dependency>

0 commit comments

Comments
 (0)