Skip to content

Continuous Delivery #32

Continuous Delivery

Continuous Delivery #32

Workflow file for this run

name: Continuous Delivery
on:
push:
tags: 'v*' # push events to matching v*, i.e. v1.0, v20.15.10
env:
PYTHON_DEFAULT_VERSION: "3.11"
jobs:
deploy:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
B2_PYPI_PASSWORD: ${{ secrets.B2_PYPI_PASSWORD }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: python -m pip install --upgrade nox pip setuptools
- name: Build the distribution
id: build
run: nox -vs build
- name: Read the Changelog
id: read-changelog
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.build.outputs.version }}
- name: Create GitHub release and upload the distribution
id: create-release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.build.outputs.version }}
body: ${{ steps.read-changelog.outputs.changes }}
draft: ${{ env.ACTIONS_STEP_DEBUG == 'true' }}
prerelease: false
files: ${{ steps.build.outputs.asset_path }}
- name: Upload the distribution to PyPI
if: ${{ env.B2_PYPI_PASSWORD != '' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ env.B2_PYPI_PASSWORD }}