Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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@v5 | |
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 |