-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(release/py): add GitHub Actions workflow for releasing Python pack…
…age (#19) * ci(release/py): add GitHub Actions workflow for releasing Python package * chore: set project metadata for workspace python packages * chore: add `uv lock` pre-commit hook
- Loading branch information
Showing
9 changed files
with
186 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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,89 @@ | ||
# refer to: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | ||
|
||
# WARNING: Do not change the name of this file, keep `publish-py.yml`. | ||
# "trusted publishing" will check the name of the workflow file. | ||
|
||
name: Publish Python 🐍 distribution 📦 to PyPI | ||
|
||
on: | ||
push: | ||
tags: | ||
# e.g., py/pyo3-utils/v0.1.0 | ||
- py/*/v* | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
# NOTE: It's better not to use cache for release workflow. | ||
jobs: | ||
build-dist: | ||
name: Build distribution 📦 | ||
runs-on: ubuntu-latest | ||
outputs: | ||
package: ${{ steps.dry-run.outputs.package }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: setup-envs-ver | ||
id: setup-envs-ver | ||
uses: ./.github/actions/setup-envs-ver | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
# see: <https://docs.astral.sh/uv/guides/integration/github/> | ||
version: ${{ steps.setup-envs-ver.outputs.uv }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: "pyproject.toml" | ||
|
||
- name: Build a binary wheel and a source tarball (e.g., dry-run) | ||
id: dry-run | ||
run: python ./release.py ${{ github.ref }} | ||
|
||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
if-no-files-found: error | ||
|
||
publish-to-pypi: | ||
needs: | ||
- build-dist | ||
name: Publish Python 🐍 distribution 📦 to PyPI | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/project/${{ needs.build-dist.outputs.package }} | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
github-release: | ||
needs: | ||
- publish-to-pypi | ||
name: Create GitHub release 🏷️ | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # IMPORTANT: mandatory for creating release | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Create release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
draft: true | ||
body: ${{ github.event.head_commit.message }} | ||
artifacts: dist/*.whl,dist/*.tar.gz |
This file contains 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 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 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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
[project] | ||
name = "codelldb" | ||
version = "0.1.0" | ||
version = "0.1.0-beta.0" | ||
readme = "README.md" | ||
license = "Apache-2.0" | ||
authors = [ | ||
{ name = "Sean Wang", email = "[email protected]" }, | ||
] | ||
description = "Launch CodeLLDB in debugpy to debug rust code." | ||
requires-python = ">=3.9" | ||
|
||
# NOTE: DO NOT use third-party libraries in this file, | ||
|
This file contains 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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
[project] | ||
name = "pyo3-utils" | ||
version = "0.1.0" | ||
version = "0.1.0-beta.0" | ||
readme = "README.md" | ||
license = "Apache-2.0" | ||
authors = [ | ||
{ name = "Sean Wang", email = "[email protected]" }, | ||
] | ||
description = "Python integration for the pyo3-utils crate." | ||
requires-python = ">=3.9" | ||
|
||
# <https://iscinumpy.dev/post/bound-version-constraints/> | ||
dependencies = ["typing-extensions >= 4"] | ||
|
||
[build-system] | ||
|
This file contains 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 |
---|---|---|
@@ -1,9 +1,23 @@ | ||
[project] | ||
name = "pytauri-plugin-notification" | ||
version = "0.1.0" | ||
version = "0.1.0-beta.0" | ||
readme = "README.md" | ||
license = "Apache-2.0" | ||
requires-python = ">=3.9" | ||
dependencies = ["typing-extensions >= 4"] | ||
authors = [ | ||
{ name = "Sean Wang", email = "[email protected]" }, | ||
] | ||
description = "tauri-plugin-notification binding for PyTauri." | ||
|
||
# <https://iscinumpy.dev/post/bound-version-constraints/> | ||
dependencies = [ | ||
"typing-extensions >= 4", | ||
# workspaces, must use `==` | ||
"pytauri == 0.1.*", | ||
] | ||
|
||
[tool.uv.sources] | ||
pytauri = { workspace = true } | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
|
This file contains 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 |
---|---|---|
@@ -1,22 +1,29 @@ | ||
[project] | ||
name = "pytauri" | ||
version = "0.1.0" | ||
version = "0.1.0-beta.0" | ||
readme = "README.md" | ||
license = "Apache-2.0" | ||
authors = [ | ||
{ name = "Sean Wang", email = "[email protected]" }, | ||
] | ||
requires-python = ">=3.9" | ||
description = "Tauri binding for Python through Pyo3." | ||
|
||
# <https://iscinumpy.dev/post/bound-version-constraints/> | ||
dependencies = [ | ||
"pydantic == 2.*", | ||
"anyio == 4.*", | ||
"pydantic >= 2", | ||
"anyio >= 4", | ||
"typing-extensions >= 4", | ||
# See: <https://pypi.org/project/backports.entry-points-selectable/> | ||
# and: <https://docs.python.org/3/library/importlib.metadata.html#entry-points> | ||
# Deprecated: once we no longer support versions Python 3.9, we can remove this dependency. | ||
"importlib-metadata >= 3.6", | ||
# workspaces | ||
"pyo3-utils", | ||
"importlib-metadata >= 8", | ||
# workspaces, must use `==` | ||
"pyo3-utils == 0.1.*", | ||
] | ||
|
||
[tool.uv.sources] | ||
pyo3-utils= { workspace = true } | ||
pyo3-utils = { workspace = true } | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
|
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.