Skip to content

Commit

Permalink
add workflow for publishing a release on pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjleo committed Aug 13, 2024
1 parent ef85b51 commit 26ee1cf
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/publish_pypi.yml
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

0 comments on commit 26ee1cf

Please sign in to comment.