-
Notifications
You must be signed in to change notification settings - Fork 44
build: add how to release doc #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
| concurrency: | ||
|
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' }} | ||
|
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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
|
luoyuxia marked this conversation as resolved.
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
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 | ||
|
|
||
|
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 }}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.