Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/actions/verify-tag-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Verify that the pushed tag version matches the workspace package version in Cargo.toml.
# 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.
# Requires: checkout before this step (Cargo.toml in workspace root). Use on tag push (GITHUB_REF like refs/tags/v0.1.0).

name: 'Verify tag matches crate version'
description: 'Exits with error if GITHUB_REF tag base version does not match [workspace.package] version in Cargo.toml (strips -rc*).'

runs:
using: 'composite'
steps:
- run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
CRATE_VERSION=$(sed -n '/^\[workspace.package\]/,/^\[/p' Cargo.toml | grep '^\s*version\s*=' | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
base() { echo "$1" | sed -E 's/-rc(\.[0-9]+|[0-9]+)$//'; }
if [ "$(base "$TAG_VERSION")" != "$(base "$CRATE_VERSION")" ]; then
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."
exit 1
fi
echo "Tag and crate version match: $TAG_VERSION"
shell: bash
42 changes: 42 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Configures "Generate release notes" on GitHub Releases.
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes

changelog:
categories:
- title: Added
labels:
- feat
- feature
- title: Changed
labels:
- refactor
- title: Fixed
labels:
- fix
- bugfix
- title: Docs
labels:
- docs
- documentation
- title: CI / Build
labels:
- ci
- build
- title: Chore
labels:
- chore
174 changes: 174 additions & 0 deletions .github/workflows/release_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Publish the fluss Python binding to PyPI.
# Trigger: push tag only (e.g. v0.1.0).
# Pre-release tags (containing '-') publish to TestPyPI; release tags publish to PyPI.
#
# Token auth: set repo variable PYPI_USE_TOKEN_AUTH = 'true' and add secrets PYPI_API_TOKEN / TEST_PYPI_API_TOKEN.
# Trusted Publishing (OIDC): leave PYPI_USE_TOKEN_AUTH unset; do not pass password so the action uses OIDC.

name: Release Python

on:
push:
tags:
- "v*" # Only version-like tags (e.g. v0.1.0, v0.1.0-rc1); avoids running on arbitrary tags

Comment thread
luoyuxia marked this conversation as resolved.
concurrency:
Comment thread
luoyuxia marked this conversation as resolved.
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

permissions:
contents: read

jobs:
version-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/verify-tag-version

sdist:
runs-on: ubuntu-latest
needs: [version-check]
steps:
- uses: actions/checkout@v4

- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

- uses: PyO3/maturin-action@v1
with:
working-directory: bindings/python
command: sdist
args: -o dist

- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: bindings/python/dist

wheels:
runs-on: ${{ matrix.os }}
needs: [version-check]
strategy:
matrix:
include:
- { os: windows-latest }
- { os: macos-15-intel, target: "x86_64-apple-darwin" }
- { os: macos-15, target: "aarch64-apple-darwin" }
- { os: ubuntu-latest, target: "x86_64" }
- { os: ubuntu-latest, target: "aarch64", manylinux: "manylinux_2_28" }
steps:
- uses: actions/checkout@v4

- name: Install protoc (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

- name: Install protoc (macOS)
if: runner.os == 'macOS'
run: brew install protobuf

- name: Install protoc (Windows)
if: runner.os == 'Windows'
run: choco install protobuf -y
shell: pwsh

- uses: PyO3/maturin-action@v1
with:
working-directory: bindings/python
target: ${{ matrix.target }}
command: build
args: --release -o dist -i python3.9
manylinux: ${{ matrix.manylinux || 'auto' }}
- uses: PyO3/maturin-action@v1
with:
working-directory: bindings/python
target: ${{ matrix.target }}
command: build
args: --release -o dist -i python3.10
manylinux: ${{ matrix.manylinux || 'auto' }}
- uses: PyO3/maturin-action@v1
with:
working-directory: bindings/python
target: ${{ matrix.target }}
command: build
args: --release -o dist -i python3.11
manylinux: ${{ matrix.manylinux || 'auto' }}
- uses: PyO3/maturin-action@v1
with:
working-directory: bindings/python
target: ${{ matrix.target }}
command: build
args: --release -o dist -i python3.12
manylinux: ${{ matrix.manylinux || 'auto' }}
Comment thread
luoyuxia marked this conversation as resolved.

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.target || 'native' }}
path: bindings/python/dist

release:
name: Publish to PyPI
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
needs: [version-check, sdist, wheels]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: bindings/python/dist

- name: Publish to TestPyPI (token)
if: contains(github.ref, '-') && vars.PYPI_USE_TOKEN_AUTH == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
packages-dir: bindings/python/dist
password: ${{ secrets.TEST_PYPI_API_TOKEN }}

- name: Publish to TestPyPI (Trusted Publishing)
if: contains(github.ref, '-') && vars.PYPI_USE_TOKEN_AUTH != 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
packages-dir: bindings/python/dist

- name: Publish to PyPI (token)
if: ${{ !contains(github.ref, '-') && vars.PYPI_USE_TOKEN_AUTH == 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
packages-dir: bindings/python/dist
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Publish to PyPI (Trusted Publishing)
if: ${{ !contains(github.ref, '-') && vars.PYPI_USE_TOKEN_AUTH != 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
packages-dir: bindings/python/dist
60 changes: 60 additions & 0 deletions .github/workflows/release_rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Publish the fluss Rust crate to crates.io.
# Trigger: push tag only (e.g. v0.1.0).
# Pre-release tags (containing '-') do not publish; release tags publish to crates.io.
#
# Token auth: set repo variable CARGO_USE_TOKEN_AUTH = 'true' and add secret CARGO_REGISTRY_TOKEN.
# Trusted Publishing (OIDC): leave CARGO_USE_TOKEN_AUTH unset; token is obtained via OIDC (no secret).

name: Release Rust

on:
push:
tags:
- "v*" # Only version-like tags (e.g. v0.1.0, v0.1.0-rc1); avoids running on arbitrary tags

Comment thread
luoyuxia marked this conversation as resolved.
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

Comment thread
luoyuxia marked this conversation as resolved.
- uses: ./.github/actions/verify-tag-version

- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

- name: Dry run (crates/fluss)
run: cargo publish -p fluss-rs --dry-run

- name: Get crates.io token (OIDC)
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-') && vars.CARGO_USE_TOKEN_AUTH != 'true'
uses: rust-lang/crates-io-auth-action@v1
id: auth
with:
token-type: publish

Comment thread
luoyuxia marked this conversation as resolved.
- name: Publish fluss-rs to crates.io
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-')
run: cargo publish -p fluss-rs
env:
CARGO_REGISTRY_TOKEN: "${{ vars.CARGO_USE_TOKEN_AUTH == 'true' && secrets.CARGO_REGISTRY_TOKEN || steps.auth.outputs.token }}"
12 changes: 7 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@
# under the License.

[workspace.package]
categories = ["command-line-utilities"]
authors = ["Apache Fluss <dev@fluss.apache.org>"]
categories = ["api-bindings", "database"]
description = "The rust implementation of fluss"
repository = "https://github.com/apache/fluss-rust"
edition = "2024"
version = "0.1.0"
homepage = "https://fluss.apache.org/"
license = "Apache-2.0"
repository = "https://github.com/apache/fluss-rust"
rust-version = "1.85"
version = "0.1.0"
keywords = ["fluss", "streaming-storage", "datalake"]

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

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

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ Then, stop your Fluss cluster. Go to your Fluss home, stop it via the following
./bin/local-cluster.sh stop
```

## Documentation

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

## License

Expand Down
6 changes: 3 additions & 3 deletions bindings/cpp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

[package]
name = "fluss-cpp"
version = "0.1.0"
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
Expand All @@ -30,8 +30,8 @@ crate-type = ["staticlib"]
anyhow = "1.0"
arrow = { workspace = true, features = ["ffi"] }
cxx = "1.0"
fluss = { path = "../../crates/fluss" }
tokio = { version = "1.27", features = ["rt-multi-thread", "macros"] }
fluss = { workspace = true, features = ["storage-all"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }

[build-dependencies]
cxx-build = "1.0"
Loading
Loading