Skip to content

Lock file maintenance #158

Lock file maintenance

Lock file maintenance #158

Workflow file for this run

name: Packaging
on:
push:
release:
# "released" events are emitted either when directly be released or be edited from pre-released.
types: [prereleased, released]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Set up poetry
uses: abatilo/actions-poetry@v2
- name: Cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-build-${{ matrix.python }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.python }}-${{ hashFiles('**/poetry.lock') }}
${{ runner.os }}-build-${{ matrix.python }}-
${{ runner.os }}-
- run: poetry install
- name: Build
# I use poetry just as a package manager, so this is not `poetry build`
run: poetry run poe build
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release' && github.event.release.prerelease
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
if: github.event_name == 'release' && !github.event.release.prerelease
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}