-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow for publishing a release on pypi
- Loading branch information
Showing
1 changed file
with
50 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,50 @@ | ||
name: Build and publish on PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
tags: ["v*.*.*"] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build package | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Check out ${{ github.ref_name }} | ||
uses: actions/checkout@v4 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- name: Install build | ||
run: | | ||
python -m pip install build | ||
- name: Run build | ||
run: python -m build | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
publish_pypi: | ||
name: Publish on PyPI | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/project/fast-forward-indexes/ | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download the distribution packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 |