Skip to content

Commit f1df2d2

Browse files
committed
build: add how to release doc
1 parent 251877c commit f1df2d2

11 files changed

Lines changed: 946 additions & 0 deletions

File tree

.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: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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+
# First publish: add repo secrets PYPI_API_TOKEN and/or TEST_PYPI_API_TOKEN (from pypi.org / test.pypi.org);
23+
# CI will use them. After Trusted Publishing is set up on PyPI/TestPyPI, you can remove the secrets.
24+
25+
name: Release Python
26+
27+
on:
28+
push:
29+
tags:
30+
- "*"
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+
sdist:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Install protoc
46+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
47+
48+
- uses: PyO3/maturin-action@v1
49+
with:
50+
working-directory: bindings/python
51+
command: sdist
52+
args: -o dist
53+
54+
- name: Upload sdist
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: wheels-sdist
58+
path: bindings/python/dist
59+
60+
wheels:
61+
runs-on: ${{ matrix.os }}
62+
strategy:
63+
matrix:
64+
include:
65+
- { os: windows-latest }
66+
- { os: macos-15-intel, target: "x86_64-apple-darwin" }
67+
- { os: macos-15, target: "aarch64-apple-darwin" }
68+
- { os: ubuntu-latest, target: "x86_64" }
69+
- { os: ubuntu-latest, target: "aarch64", manylinux: "manylinux_2_28" }
70+
steps:
71+
- uses: actions/checkout@v4
72+
73+
- name: Install protoc (Linux)
74+
if: runner.os == 'Linux'
75+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
76+
77+
- name: Install protoc (macOS)
78+
if: runner.os == 'macOS'
79+
run: brew install protobuf
80+
81+
- name: Install protoc (Windows)
82+
if: runner.os == 'Windows'
83+
run: choco install protobuf -y
84+
shell: pwsh
85+
86+
- uses: PyO3/maturin-action@v1
87+
with:
88+
working-directory: bindings/python
89+
target: ${{ matrix.target }}
90+
command: build
91+
args: --release -o dist -i python3.11
92+
manylinux: ${{ matrix.manylinux || 'auto' }}
93+
- uses: PyO3/maturin-action@v1
94+
with:
95+
working-directory: bindings/python
96+
target: ${{ matrix.target }}
97+
command: build
98+
args: --release -o dist -i python3.12
99+
manylinux: ${{ matrix.manylinux || 'auto' }}
100+
101+
- name: Upload wheels
102+
uses: actions/upload-artifact@v4
103+
with:
104+
name: wheels-${{ matrix.os }}-${{ matrix.target || 'native' }}
105+
path: bindings/python/dist
106+
107+
release:
108+
name: Publish to PyPI
109+
runs-on: ubuntu-latest
110+
permissions:
111+
contents: read
112+
id-token: write
113+
needs: [sdist, wheels]
114+
if: startsWith(github.ref, 'refs/tags/')
115+
steps:
116+
- uses: actions/download-artifact@v4
117+
with:
118+
pattern: wheels-*
119+
merge-multiple: true
120+
path: bindings/python/dist
121+
122+
- name: Publish to TestPyPI (pre-release tags)
123+
if: contains(github.ref, '-')
124+
uses: pypa/gh-action-pypi-publish@release/v1
125+
with:
126+
repository-url: https://test.pypi.org/legacy/
127+
skip-existing: true
128+
packages-dir: bindings/python/dist
129+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
130+
131+
- name: Publish to PyPI (release tags)
132+
if: ${{ !contains(github.ref, '-') }}
133+
uses: pypa/gh-action-pypi-publish@release/v1
134+
with:
135+
skip-existing: true
136+
packages-dir: bindings/python/dist
137+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/release_rust.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
# First publish: add repo secret CARGO_REGISTRY_TOKEN (crates.io API token); CI will use it.
23+
# After crate exists: set up Trusted Publishing on the crate page, then remove the secret; CI will use OIDC.
24+
25+
name: Release Rust
26+
27+
on:
28+
push:
29+
tags:
30+
- "*"
31+
32+
jobs:
33+
publish:
34+
runs-on: ubuntu-latest
35+
permissions:
36+
id-token: write
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Install protoc
41+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
42+
43+
- name: Dry run (crates/fluss)
44+
run: cargo publish -p fluss-rs --dry-run
45+
46+
- name: Get crates.io token (OIDC)
47+
if: secrets.CARGO_REGISTRY_TOKEN == ''
48+
uses: rust-lang/crates-io-auth-action@v1
49+
id: auth
50+
with:
51+
token-type: publish
52+
53+
- name: Publish fluss-rs to crates.io
54+
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-')
55+
run: cargo publish -p fluss-rs --no-verify
56+
env:
57+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN || steps.auth.outputs.token }}

docs/assets/release-guide.png

355 KB
Loading

0 commit comments

Comments
 (0)