Skip to content

Commit

Permalink
prep for CICD
Browse files Browse the repository at this point in the history
  • Loading branch information
gillespied committed Dec 2, 2024
1 parent 6ca4243 commit 1e9668a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to PyPI

on:
push:
tags:
- "v*.*.*" # Matches version tags like v1.2.3

permissions:
contents: read
id-token: write # Required for OIDC authentication

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: Install dependencies
run: pip install .[dev]

- name: Build package
run: python -m build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"Operating System :: OS Independent",
],
python_requires=">=3.8",
use_scm_version={
"write_to": "src/batch_please/_version.py",
},
setup_requires=["setuptools_scm"],
install_requires=[
"tqdm",
],
Expand Down
5 changes: 4 additions & 1 deletion src/batch_processors/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
__version__ = "0.1.0"
try:
from ._version import version as __version__
except ImportError:
__version__ = "unknown"

from .batchers import AsyncBatchProcessor, BatchProcessor

Expand Down

0 comments on commit 1e9668a

Please sign in to comment.