Publish to PyPI #71
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
name: Publish to PyPI | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version to tag" | |
required: true | |
jobs: | |
publish-cpp: | |
environment: prod | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ^3.10 | |
- name: Install requirements | |
run: |- | |
pip install twine | |
- name: Update version | |
working-directory: hyperon_das_atomdb_cpp | |
run: sed -i 's/version = ".*"/version = "${{ github.event.inputs.version }}"/' pyproject.toml | |
- name: Build Wheel | |
working-directory: hyperon_das_atomdb_cpp | |
run: make wheel | |
- name: Publish Package | |
working-directory: hyperon_das_atomdb_cpp/dist | |
run: twine upload $(find . -name *.whl | head -n 1) --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} --non-interactive |