Skip to content

Commit 499fa8c

Browse files
authored
build: add how to release doc (#268)
1 parent ff879b9 commit 499fa8c

19 files changed

Lines changed: 1114 additions & 17 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. 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,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Verify that the pushed tag version matches the workspace package version in Cargo.toml.
19+
# Tag v0.2.0 or v0.2.0-rc1; Cargo 0.2.0. Compare base version (strip -rc*): both pass when Cargo is 0.2.0.
20+
# Requires: checkout before this step (Cargo.toml in workspace root). Use on tag push (GITHUB_REF like refs/tags/v0.1.0).
21+
22+
name: 'Verify tag matches crate version'
23+
description: 'Exits with error if GITHUB_REF tag base version does not match [workspace.package] version in Cargo.toml (strips -rc*).'
24+
25+
runs:
26+
using: 'composite'
27+
steps:
28+
- run: |
29+
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
30+
CRATE_VERSION=$(sed -n '/^\[workspace.package\]/,/^\[/p' Cargo.toml | grep '^\s*version\s*=' | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
31+
base() { echo "$1" | sed -E 's/-rc(\.[0-9]+|[0-9]+)$//'; }
32+
if [ "$(base "$TAG_VERSION")" != "$(base "$CRATE_VERSION")" ]; then
33+
echo "::error::Tag version ($TAG_VERSION) does not match Cargo.toml version ($CRATE_VERSION). Run scripts/bump-version.sh before tagging, or tag the version that is in Cargo.toml."
34+
exit 1
35+
fi
36+
echo "Tag and crate version match: $TAG_VERSION"
37+
shell: bash

.github/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to you under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Configures "Generate release notes" on GitHub Releases.
17+
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
18+
19+
changelog:
20+
categories:
21+
- title: Added
22+
labels:
23+
- feat
24+
- feature
25+
- title: Changed
26+
labels:
27+
- refactor
28+
- title: Fixed
29+
labels:
30+
- fix
31+
- bugfix
32+
- title: Docs
33+
labels:
34+
- docs
35+
- documentation
36+
- title: CI / Build
37+
labels:
38+
- ci
39+
- build
40+
- title: Chore
41+
labels:
42+
- chore
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. 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,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Publish the fluss Python binding to PyPI.
19+
# Trigger: push tag only (e.g. v0.1.0).
20+
# Pre-release tags (containing '-') publish to TestPyPI; release tags publish to PyPI.
21+
#
22+
# Token auth: set repo variable PYPI_USE_TOKEN_AUTH = 'true' and add secrets PYPI_API_TOKEN / TEST_PYPI_API_TOKEN.
23+
# Trusted Publishing (OIDC): leave PYPI_USE_TOKEN_AUTH unset; do not pass password so the action uses OIDC.
24+
25+
name: Release Python
26+
27+
on:
28+
push:
29+
tags:
30+
- "v*" # Only version-like tags (e.g. v0.1.0, v0.1.0-rc1); avoids running on arbitrary tags
31+
32+
concurrency:
33+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
34+
cancel-in-progress: true
35+
36+
permissions:
37+
contents: read
38+
39+
jobs:
40+
version-check:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: ./.github/actions/verify-tag-version
45+
46+
sdist:
47+
runs-on: ubuntu-latest
48+
needs: [version-check]
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- name: Install protoc
53+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
54+
55+
- uses: PyO3/maturin-action@v1
56+
with:
57+
working-directory: bindings/python
58+
command: sdist
59+
args: -o dist
60+
61+
- name: Upload sdist
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: wheels-sdist
65+
path: bindings/python/dist
66+
67+
wheels:
68+
runs-on: ${{ matrix.os }}
69+
needs: [version-check]
70+
strategy:
71+
matrix:
72+
include:
73+
- { os: windows-latest }
74+
- { os: macos-15-intel, target: "x86_64-apple-darwin" }
75+
- { os: macos-15, target: "aarch64-apple-darwin" }
76+
- { os: ubuntu-latest, target: "x86_64" }
77+
- { os: ubuntu-latest, target: "aarch64", manylinux: "manylinux_2_28" }
78+
steps:
79+
- uses: actions/checkout@v4
80+
81+
- name: Install protoc (Linux)
82+
if: runner.os == 'Linux'
83+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
84+
85+
- name: Install protoc (macOS)
86+
if: runner.os == 'macOS'
87+
run: brew install protobuf
88+
89+
- name: Install protoc (Windows)
90+
if: runner.os == 'Windows'
91+
run: choco install protobuf -y
92+
shell: pwsh
93+
94+
- uses: PyO3/maturin-action@v1
95+
with:
96+
working-directory: bindings/python
97+
target: ${{ matrix.target }}
98+
command: build
99+
args: --release -o dist -i python3.9
100+
manylinux: ${{ matrix.manylinux || 'auto' }}
101+
- uses: PyO3/maturin-action@v1
102+
with:
103+
working-directory: bindings/python
104+
target: ${{ matrix.target }}
105+
command: build
106+
args: --release -o dist -i python3.10
107+
manylinux: ${{ matrix.manylinux || 'auto' }}
108+
- uses: PyO3/maturin-action@v1
109+
with:
110+
working-directory: bindings/python
111+
target: ${{ matrix.target }}
112+
command: build
113+
args: --release -o dist -i python3.11
114+
manylinux: ${{ matrix.manylinux || 'auto' }}
115+
- uses: PyO3/maturin-action@v1
116+
with:
117+
working-directory: bindings/python
118+
target: ${{ matrix.target }}
119+
command: build
120+
args: --release -o dist -i python3.12
121+
manylinux: ${{ matrix.manylinux || 'auto' }}
122+
123+
- name: Upload wheels
124+
uses: actions/upload-artifact@v4
125+
with:
126+
name: wheels-${{ matrix.os }}-${{ matrix.target || 'native' }}
127+
path: bindings/python/dist
128+
129+
release:
130+
name: Publish to PyPI
131+
runs-on: ubuntu-latest
132+
permissions:
133+
contents: read
134+
id-token: write
135+
needs: [version-check, sdist, wheels]
136+
if: startsWith(github.ref, 'refs/tags/')
137+
steps:
138+
- uses: actions/download-artifact@v4
139+
with:
140+
pattern: wheels-*
141+
merge-multiple: true
142+
path: bindings/python/dist
143+
144+
- name: Publish to TestPyPI (token)
145+
if: contains(github.ref, '-') && vars.PYPI_USE_TOKEN_AUTH == 'true'
146+
uses: pypa/gh-action-pypi-publish@release/v1
147+
with:
148+
repository-url: https://test.pypi.org/legacy/
149+
skip-existing: true
150+
packages-dir: bindings/python/dist
151+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
152+
153+
- name: Publish to TestPyPI (Trusted Publishing)
154+
if: contains(github.ref, '-') && vars.PYPI_USE_TOKEN_AUTH != 'true'
155+
uses: pypa/gh-action-pypi-publish@release/v1
156+
with:
157+
repository-url: https://test.pypi.org/legacy/
158+
skip-existing: true
159+
packages-dir: bindings/python/dist
160+
161+
- name: Publish to PyPI (token)
162+
if: ${{ !contains(github.ref, '-') && vars.PYPI_USE_TOKEN_AUTH == 'true' }}
163+
uses: pypa/gh-action-pypi-publish@release/v1
164+
with:
165+
skip-existing: true
166+
packages-dir: bindings/python/dist
167+
password: ${{ secrets.PYPI_API_TOKEN }}
168+
169+
- name: Publish to PyPI (Trusted Publishing)
170+
if: ${{ !contains(github.ref, '-') && vars.PYPI_USE_TOKEN_AUTH != 'true' }}
171+
uses: pypa/gh-action-pypi-publish@release/v1
172+
with:
173+
skip-existing: true
174+
packages-dir: bindings/python/dist

.github/workflows/release_rust.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. 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,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Publish the fluss Rust crate to crates.io.
19+
# Trigger: push tag only (e.g. v0.1.0).
20+
# Pre-release tags (containing '-') do not publish; release tags publish to crates.io.
21+
#
22+
# Token auth: set repo variable CARGO_USE_TOKEN_AUTH = 'true' and add secret CARGO_REGISTRY_TOKEN.
23+
# Trusted Publishing (OIDC): leave CARGO_USE_TOKEN_AUTH unset; token is obtained via OIDC (no secret).
24+
25+
name: Release Rust
26+
27+
on:
28+
push:
29+
tags:
30+
- "v*" # Only version-like tags (e.g. v0.1.0, v0.1.0-rc1); avoids running on arbitrary tags
31+
32+
jobs:
33+
publish:
34+
runs-on: ubuntu-latest
35+
permissions:
36+
contents: read
37+
id-token: write
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- uses: ./.github/actions/verify-tag-version
42+
43+
- name: Install protoc
44+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
45+
46+
- name: Dry run (crates/fluss)
47+
run: cargo publish -p fluss-rs --dry-run
48+
49+
- name: Get crates.io token (OIDC)
50+
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-') && vars.CARGO_USE_TOKEN_AUTH != 'true'
51+
uses: rust-lang/crates-io-auth-action@v1
52+
id: auth
53+
with:
54+
token-type: publish
55+
56+
- name: Publish fluss-rs to crates.io
57+
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-')
58+
run: cargo publish -p fluss-rs
59+
env:
60+
CARGO_REGISTRY_TOKEN: "${{ vars.CARGO_USE_TOKEN_AUTH == 'true' && secrets.CARGO_REGISTRY_TOKEN || steps.auth.outputs.token }}"

Cargo.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,26 @@
1616
# under the License.
1717

1818
[workspace.package]
19-
categories = ["command-line-utilities"]
19+
authors = ["Apache Fluss <dev@fluss.apache.org>"]
20+
categories = ["api-bindings", "database"]
2021
description = "The rust implementation of fluss"
21-
repository = "https://github.com/apache/fluss-rust"
2222
edition = "2024"
23-
version = "0.1.0"
23+
homepage = "https://fluss.apache.org/"
2424
license = "Apache-2.0"
25+
repository = "https://github.com/apache/fluss-rust"
2526
rust-version = "1.85"
27+
version = "0.1.0"
28+
keywords = ["fluss", "streaming-storage", "datalake"]
2629

2730
[workspace]
2831
resolver = "2"
2932
members = ["crates/fluss", "crates/examples", "bindings/python", "bindings/cpp"]
3033

3134
[workspace.dependencies]
32-
fluss = { version = "0.1.0", path = "./crates/fluss" }
35+
fluss = { package = "fluss-rs", version = "0.1.0", path = "crates/fluss", features = ["storage-all"] }
3336
tokio = { version = "1.44.2", features = ["full"] }
3437
clap = { version = "4.5.37", features = ["derive"] }
3538
arrow = { version = "57.0.0", features = ["ipc_compression"] }
36-
chrono = { version = "0.4", features = ["clock", "std", "wasmbind"] }
3739

3840
serde = { version = "1.0", features = ["derive"] }
3941
serde_json = "1.0"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ Then, stop your Fluss cluster. Go to your Fluss home, stop it via the following
133133
./bin/local-cluster.sh stop
134134
```
135135

136+
## Documentation
137+
138+
- [Development Guide](DEVELOPMENT.md) – Build, test, and contribute to fluss-rust.
139+
- [Release Guide](docs/creating-a-release.md) – How to build, release, and sign official Fluss client packages (Rust, Python, C++).
136140

137141
## License
138142

bindings/cpp/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
[package]
1919
name = "fluss-cpp"
20-
version = "0.1.0"
20+
version.workspace = true
2121
edition.workspace = true
2222
license.workspace = true
2323
rust-version.workspace = true
@@ -30,8 +30,8 @@ crate-type = ["staticlib"]
3030
anyhow = "1.0"
3131
arrow = { workspace = true, features = ["ffi"] }
3232
cxx = "1.0"
33-
fluss = { path = "../../crates/fluss" }
34-
tokio = { version = "1.27", features = ["rt-multi-thread", "macros"] }
33+
fluss = { workspace = true, features = ["storage-all"] }
34+
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
3535

3636
[build-dependencies]
3737
cxx-build = "1.0"

0 commit comments

Comments
 (0)