Skip to content

Commit

Permalink
add new workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AVoss84 committed Jan 25, 2025
1 parent 4b1449f commit 50b47df
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/publish_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish to Test PyPI
on:
push:
tags:
- "0.2.1" # Or "v*", "0.*", etc. to match your desired tag pattern
- "0.2.1" # or "v*", "0.*", etc. depending on your tag pattern

jobs:
build-and-upload:
Expand All @@ -23,28 +23,23 @@ jobs:
python -m pip install --upgrade pip
python -m pip install build twine
# ------------------------
# (A) Optional: Install your package in dev mode + test dependencies
- name: Install package + test deps (dev mode)
# (A) Install your package in editable mode with the "notebook" extras (which includes pytest)
- name: Install package + 'notebook' extras
run: |
# If you have a test extra in pyproject.toml like `[project.optional-dependencies].test = ["pytest", ...]`, do:
# python -m pip install -e ".[test]"
#
# Otherwise, just install pytest (and any other testing deps) directly:
python -m pip install -e .
python -m pip install pytest
python -m pip install -e ".[notebook]"
# (B) Run your tests
- name: Run tests
run: |
pytest --verbose
# ------------------------
# (C) Build the package
- name: Build the package
run: python -m build

# (D) Upload to Test PyPI (only if tests passed)
- name: Upload to Test PyPI
if: success() # Only runs if tests passed
if: success()
run: |
twine upload --repository testpypi dist/*
env:
Expand Down

0 comments on commit 50b47df

Please sign in to comment.