0.2.0 #5
Workflow file for this run
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 Package | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: # enables manual triggering | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Validate Version | |
run: | | |
latest_version=$(curl -s https://pypi.org/pypi/views-stepshifter/json | jq -r .info.version) | |
new_version=$(python -c "import toml; print(toml.load('pyproject.toml')['tool']['poetry']['version'])") | |
python -c "from packaging.version import parse; assert parse('$new_version') > parse('$latest_version'), 'Version must be higher than $latest_version'" | |
- name: Publish to PyPI | |
run: poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }} |