Skip to content

Publish Python Package #15

Publish Python Package

Publish Python Package #15

Workflow file for this run

name: Publish Python Package
on:
release:
types: [published]
jobs:
pypi-publish:
name: Publish release to PyPI
if: startsWith(github.ref, 'refs/tags/python')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/starpoint
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
defaults:
run:
working-directory: ./python
steps:
- name: Print SHA then git log
run: |
echo $GITHUB_SHA
git log | head -n 50
# TODO: Uncomment after tested
# - uses: actions/checkout@v3
# with:
# ref: GITHUB_SHA
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.x'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install build twine
# - name: Build package
# run: |
# python -m build
# twine check --strict dist/*
# - name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# packages-dir: ./python/dist/