Skip to content

[AUTO] Bump version #87

[AUTO] Bump version

[AUTO] Bump version #87

name: Unit Tests, build & deploy library
on:
push:
branches: [ main ]
jobs:
# BUILD AND TEST THE LIBRARY
build:
if: contains(github.event.head_commit.message, '[AUTO]') == false
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9.13"]
steps:
- uses: actions/checkout@v4
# with:
# token: ${{ secrets.REPO_ACCESS_TOKEN }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest redis
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Running all PyTests
run: |
pytest -s -vv
# DEPLOY THE LIBRARY TO PYPI
pypi-publish:
needs: build
#if: github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, '[AUTO]') == false
name: upload release to PyPI
runs-on: ubuntu-latest
#environment: release # Define your GitHub Environment name here
permissions:
id-token: write # Required for OIDC
contents: read
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9.13
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build bumpver --upgrade setuptools
- name: Configure git
run: |
git config --local user.email "brayan@brayan.com"
git config --local user.name "svabra"
# Only bump version if not an [AUTO] commit
- name: Bump version
if: contains(github.event.head_commit.message, '[AUTO]') == false
run: bumpver update --patch --commit-message "[AUTO] Bump version"
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1