Skip to content

Publish Packages on Release #5

Publish Packages on Release

Publish Packages on Release #5

Workflow file for this run

# Create and Publish repository Packages
name: Publish Packages on Release
on:
release:
types: [ created ]
jobs:
publish:
runs-on: ubuntu-latest
environment:
name: deployment
permissions:
contents: read
packages: write
id-token: write
name: Publish Release
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install build requirements
run: python -m pip install build setuptools twine --user
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/
- name: Sign Distributions
uses: dk96-os/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Cleanup Dist Directory after signing
run: |
cd dist
echo "Removing files that do not match '*.tar.gz' or '*.whl'"
for file in *; do
if [[ ! "$file" == *".tar.gz" ]] && [[ ! "$file" == *".whl" ]]; then
echo "Removing: $file"
rm "$file"
fi
done
cd ../
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
print-hash: true