Skip to content

v0.4.1

v0.4.1 #10

Workflow file for this run

name: Publish package to PyPI
on:
release:
types:
- published
permissions:
contents: read
jobs:
build:
name: Build distribution packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
- name: Install pypa/build
run: python -m pip install --user build
- name: Build packages
run: python -m build
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
if-no-files-found: error
test:
name: Run tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
- name: Download package
uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- name: Install dependencies and package
run: |
python -m pip install ruff pytest
python -m pip install --no-index --find-links ./dist/ pypipe-ppp
- name: Lint with Ruff
run: ruff --output-format=github --target-version=py310 .
- name: Test with pytest
run: pytest -v -s
publish-to-test-pypi:
name: Publish packages to Test PyPI
runs-on: ubuntu-latest
# List the jobs that this one directly depends on:
# - build because it needs the package to be built
# - test to make sure it doesn't try uploading before tests pass
needs:
- build
- test
environment: test-pypi
permissions:
# this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- name: Publish packages to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
print-hash: true
publish-to-pypi:
name: Publish packages to PyPI
runs-on: ubuntu-latest
# List the jobs that this one directly depends on:
# - build because it needs the package to be built
# - publish-to-test-pypi to make sure it doesn't try the real upload before the test one succeeds
needs:
- build
- publish-to-test-pypi
environment: pypi
permissions:
# this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- name: Publish packages to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
print-hash: true