Skip to content

Commit

Permalink
publish to PyPI (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
callumrollo authored Oct 25, 2024
1 parent 2e800e9 commit 9db9c7f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish to PyPI

on:
release:
types:
- published

jobs:
packages:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
shell: bash

- name: Install build tools
run: |
python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine
shell: bash

- name: Build binary wheel
run: python -m build --sdist --wheel . --outdir dist

- name: CheckFiles
run: |
ls dist
shell: bash

- name: Test wheels
run: |
cd dist && python -m pip install *.whl
python -m twine check *
shell: bash

- name: Publish a Python distribution to PyPI
if: success() && github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,13 @@ readme = { file = "README.md", content-type = "text/markdown" }
write_to = "glidertest/_version.py"
write_to_template = "__version__ = '{version}'"
tag_regex = "^(?P<prefix>v)?(?P<version>[^\\+]+)(?P<suffix>.*)?$"

[tool.check-manifest]
ignore = [
"docs",
"docs/*",
"notebooks",
"notebooks/*",
"tests",
"tests/*",
]

0 comments on commit 9db9c7f

Please sign in to comment.