update GitHub Actions workflow to trigger on release branch and bump … #9
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: Publish to PyPI | |
on: | |
push: | |
branches: | |
- release | |
workflow_dispatch: | |
jobs: | |
publish: | |
name: Build and Publish bp_osd | |
runs-on: ubuntu-latest | |
steps: | |
# Check out the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' # Minimum Python version required | |
# Install build dependencies | |
- name: Install build tools | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build | |
# Build the package | |
- name: Build package | |
run: | | |
python -m build --wheel --outdir ./wheelhouse | |
# Install twine | |
- name: Install twine | |
run: | | |
python -m pip install --upgrade twine | |
# Publish to PyPI | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.BPOSD_PYPI_PASSWORD }} | |
run: | | |
twine upload ./wheelhouse/bposd*whl |