d8dd978730
Bumps [snok/install-poetry](https://github.com/snok/install-poetry) from 1.3.4 to 1.4.0. - [Release notes](https://github.com/snok/install-poetry/releases) - [Commits](https://github.com/snok/install-poetry/compare/v1.3.4...v1.4.0) --- updated-dependencies: - dependency-name: snok/install-poetry dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
68 lines
1.9 KiB
YAML
68 lines
1.9 KiB
YAML
# This workflows will upload a Python Package using Twine when a release is created
|
|
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
|
|
|
name: publish
|
|
|
|
on:
|
|
release:
|
|
types: [created]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
POETRY_VERSION: "1.6.1"
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
matrix:
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Add poetry to windows path
|
|
if: "startsWith(runner.os, 'windows')"
|
|
run: |
|
|
echo "C:\Users\runneradmin\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
|
|
- name: Install and configure Poetry
|
|
uses: snok/install-poetry@v1.4.0
|
|
with:
|
|
version: ${{ env.POETRY_VERSION }}
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
|
|
- name: Display Python version
|
|
run: poetry run python -c "import sys; print(sys.version)"
|
|
|
|
- name: Build packages
|
|
run: poetry build
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
poetry run pip install --upgrade pip
|
|
poetry run pip install twine
|
|
|
|
- name: Build and publish
|
|
env:
|
|
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
|
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
run: |
|
|
poetry run twine upload dist/*.whl
|
|
|
|
- name: Build and publish (source)
|
|
if: ${{ startsWith(runner.os, 'windows') && matrix.python-version == '3.11' }}
|
|
env:
|
|
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
|
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
run: |
|
|
poetry run twine upload dist/*.tar.gz
|