mirror of https://github.com/LedFx/LedFx.git
47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
name: Publish Python distributions to PyPI
|
|
|
|
on:
|
|
release:
|
|
types:
|
|
- published
|
|
# push:
|
|
# paths-ignore:
|
|
# - 'docs/**'
|
|
# - '.*/**'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
DEFAULT_PYTHON: 3.8
|
|
|
|
jobs:
|
|
build-n-publish:
|
|
name: Build and publish Python distributions to PyPI
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code from GitHub
|
|
uses: actions/checkout@v2
|
|
- name: Setup sentry config
|
|
shell: bash
|
|
env:
|
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN_PYPI }}
|
|
run: |
|
|
sed -i 's,DSN,'"$SENTRY_DSN"',' ./ledfx/sentry_config.py
|
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
|
uses: actions/setup-python@v2.2.1
|
|
with:
|
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
|
- name: Install build dependencies
|
|
run: |
|
|
sudo apt-get update && sudo apt-get install -y \
|
|
gcc libatlas3-base portaudio19-dev
|
|
- name: Build a binary wheel and source tarball
|
|
run: |
|
|
python -m pip install --user -U pip wheel setuptools
|
|
python setup.py sdist bdist_wheel
|
|
- name: Publish distribution to PyPI
|
|
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|
|
uses: pypa/gh-action-pypi-publish@master
|
|
with:
|
|
user: __token__
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|