Skip to content

build: bump poetry.lock dependencies and pre-commit hooks (#470) #431

build: bump poetry.lock dependencies and pre-commit hooks (#470)

build: bump poetry.lock dependencies and pre-commit hooks (#470) #431

Workflow file for this run

# This is a workflow for previewing packages. It can be used for testing before a release to the "production" systems.
# It will automatically create developmental release builds and make them available for all pushes to `main`. There is
# also an ability to manually trigger this workflow, with an additional option to publish the package to TestPyPI.
---
name: Preview
on:
# Allow running this workflow manually from the Actions tab
workflow_dispatch:
inputs:
TestPyPI:
description: "Publish to TestPyPI"
type: boolean
required: true
default: false
push:
branches:
- main
jobs:
publish_preview:
name: Build and Publish for Preview
runs-on: ubuntu-latest
strategy:
matrix:
# It's only one Python version specified in a "matrix", but on purpose to stay DRY
python-version: ["3.12"]
defaults:
run:
shell: bash
steps:
- name: Checkout the repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
# `python-semantic-release` needs full history to properly determine the next release version
fetch-depth: 0
- name: Install poetry
run: pipx install poetry==1.8.3
- name: Configure poetry
run: |
poetry config virtualenvs.in-project true
poetry config repositories.testpypi https://test.pypi.org/legacy/
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install the project with poetry
run: |
poetry env use python${{ matrix.python-version }}
poetry check --lock
poetry lock --no-update --no-cache
poetry install --verbose --no-root --sync --with test,ci
- name: Make developmental release version
# poetry version rules do not provide for developmental releases as specified in PEP440.
# It can be pieced together with these commands.
run: |
curr_ver=$(poetry version --short)
next_ver=$(poetry run semantic-release -vv version --print)
if [ "${curr_ver}" = "${next_ver}" ]; then
next_ver=$(poetry run semantic-release -vv version --print --patch)
fi
poetry version "${next_ver}.dev${GITHUB_RUN_NUMBER}"
- name: Run tox via poetry
run: poetry run tox
- name: Build wheel and source distribution
run: poetry build -vvv
- name: Upload build artifacts
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: dist
path: ./dist/
if-no-files-found: error
retention-days: 7
- name: Publish to TestPyPI
if: inputs.TestPyPI
run: poetry publish --repository testpypi --username __token__ --password ${{ secrets.TESTPYPI_API_TOKEN }}