forked from rpm-software-management/fedora-distro-aliases
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github: automatically publish to PyPI
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Upload a Python package when a release is created | ||
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows | ||
|
||
name: Publish Python 🐍 distributions 📦 to PyPI | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
build-n-publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # for trusted publishing | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
|
||
- name: Get history and tags for SCM versioning to work | ||
run: | | ||
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Build a source tarball and a binary wheel | ||
# https://pypa-build.readthedocs.io | ||
run: | | ||
python -m pip install build | ||
python -m build | ||
- name: Publish 📦 to PyPI | ||
# https://github.com/pypa/gh-action-pypi-publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
verbose: true |