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
16 changes: 15 additions & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
release:
types: [published]
workflow_dispatch:
inputs:
package_version:
description: Version to build for this run (blank uses pyproject.toml)
type: string
required: false

permissions:
contents: read
Expand All @@ -33,6 +38,12 @@ jobs:
version: '0.9.22'
python-version: '3.11'

- name: Apply the requested build version
if: github.event_name == 'workflow_dispatch' && inputs.package_version != ''
env:
PACKAGE_VERSION: ${{ inputs.package_version }}
run: uv version --frozen -- "$PACKAGE_VERSION"

- name: Build the wheel and source distribution
run: |
export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)
Expand All @@ -41,7 +52,10 @@ jobs:
- name: Validate distributions and release version
id: check
env:
RELEASE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
RELEASE_TAG: >-
${{ github.ref_type == 'tag' &&
(github.event_name != 'workflow_dispatch' || inputs.package_version == '') &&
github.ref_name || '' }}
PUBLISH_TO_PYPI: ${{ github.repository == 'oceanbase/pyseekdb' && github.event_name != 'workflow_dispatch' }}
run: |
uv run --no-project --with twine python -m twine check --strict dist/*.whl dist/*.tar.gz
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ After running `make build`, the distribution files will be in the `dist/` direct

Set `project.version` in `pyproject.toml` on the commit you want to release.
Run **Publish pyseekdb to PyPI** manually in Actions to build and check the
distributions. Push a matching tag such as `v1.4.1` or publish its GitHub Release
to upload the wheel and source distribution to PyPI.
distributions. Set `package_version` to choose the version for that run, or
leave it blank to use `project.version`. Push a matching tag such as `v1.4.1`
or publish its GitHub Release to upload the wheel and source distribution to PyPI.

Configure [Trusted Publishing](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
in the PyPI `pyseekdb` project with owner `oceanbase`, repository `pyseekdb`,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pyseekdb"
version = "1.2.0.dev1"
version = "1.4.1"
description = "A unified Python client for seekdb that supports embedded, server, and OceanBase."
readme = "README.md"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading