chore: bump version (#258) #30
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: Deploy | |
on: | |
push: | |
tags: ['v*'] | |
workflow_dispatch: | |
inputs: | |
pre-release-suffix: | |
description: 'Version suffix for pre-releases ("a", "b", "rc", etc.)' | |
required: false | |
default: 'dev' | |
pre-release-version: | |
description: 'Version number for pre-releases; defaults to build number' | |
required: false | |
default: '' | |
env: | |
LATEST_PY_VERSION: '3.12' | |
jobs: | |
# Deploy stable builds on tags only, and pre-release builds from manual trigger ("workflow_dispatch") | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.LATEST_PY_VERSION }} | |
- uses: snok/[email protected] | |
with: | |
virtualenvs-in-project: true | |
- name: Set pre-release version | |
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
env: | |
pre-release-suffix: ${{ github.event.inputs.pre-release-suffix || 'dev' }} | |
pre-release-version: ${{ github.event.inputs.pre-release-version || github.run_number }} | |
run: | | |
poetry version $(poetry version -s).${{ env.pre-release-suffix }}${{ env.pre-release-version }} | |
poetry version | |
- name: Build and publish to pypi | |
run: | | |
poetry build | |
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }} |