Skip to content

Publish to PyPI

Publish to PyPI #69

Workflow file for this run

name: Publish to PyPI
on:
workflow_dispatch:
inputs:
version:
description: "Version to tag (e.g., 1.0.0)"
required: true
hyperon-das-atomdb-version:
description: "Hyperon-das-atomdb version (optional)"
required: false
jobs:
tag:
uses: singnet/das/.github/workflows/run-semver.yml@master
with:
version: ${{ github.event.inputs.version }}
version-strategy: bump-version-from-variable-value
job-image-namespace: trueagi
job-image-version-semver: semantic-versioning
main-branch: master
version-tag-regex-pattern: /^\d+\.\d+\.\d+$/
version-require-confirmation: "true"
title: New version of hyperon-das
deliverable: Library in PyPI named hyperon-das
secrets: inherit
publish:
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 Poetry
run: |
pip install poetry
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
- name: Update hyperon-das-atomdb version
if: ${{inputs.hyperon-das-atomdb-version}}
run: |-
if [[ "${{inputs.hyperon-das-atomdb-version}}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
poetry add hyperon-das-atomdb=${{inputs.hyperon-das-atomdb-version}}
else
echo "The provided version '${{inputs.hyperon-das-atomdb-version}}' is invalid."
exit 1
fi
- name: Build and Publishing library version in PyPI
run: |
poetry version ${{ github.event.inputs.version }}
poetry build
poetry publish --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}