Skip to content

Commit

Permalink
python(ci): PyPI publishing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
solidiquis committed Jun 25, 2024
1 parent 3800560 commit 8d2320f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/python_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: PyPI Publish

on:
workflow_dispatch:

jobs:
python-ci:
if: github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/tags')
uses: ./.github/workflows/python_ci.yaml

publish-to-pypi:
name: Upload release to PyPI
needs: python-ci
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
environment:
name: pypi
url: https://pypi.org/p/sift_py
permissions:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Pip install
run: |
python -m pip install --upgrade pip
pip install '.[build]'
pip install .
- name: Build distributions
working-directory: python
run: |
python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./python/dist/
3 changes: 1 addition & 2 deletions .github/workflows/python_release_dry_run.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: PyPI Publish
name: PyPI Publish (Test)

on:
pull_request:
workflow_dispatch:

jobs:
Expand Down

0 comments on commit 8d2320f

Please sign in to comment.