Skip to content

Merge pull request #2 from xmichele/hatch #6

Merge pull request #2 from xmichele/hatch

Merge pull request #2 from xmichele/hatch #6

Workflow file for this run

name: Publish to PyPI
on:
push:
branches: [ "hatch" ] #main can be added
release:
types: [published]
# permissions:
# contents: read
# id-token: write # Ensure this permission is available for trusted publishing
jobs:
deploy:
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: pip install hatch
- name: Build package
run: hatch build
- name: Test package
run: hatch -e test run nose2 --verbose
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
password: ${{ secrets.MY_PYPI_API_TOKEN }} # Ensure your PyPI API token is set in secrets otherwise use trusted publishers mode
repository-url: https://upload.pypi.org/legacy/ # Use Test PyPI or main PyPI https://upload.pypi.org/legacy/