Skip to content

Update setup.py

Update setup.py #4

Workflow file for this run

name: Python CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions: write-all
jobs:
build:
# -------- https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
name: Build distribution πŸ“¦
runs-on: ubuntu-20.04
steps:
# -------- https://github.com/actions/checkout
# check out your repository files onto the runner, so that the workflow can access them
- uses: actions/checkout@v4
# -------- https://github.com/actions/setup-python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11.0"
# --------
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black pytest
pip install -r requirements.txt
# --------
- name: Format with black
run: |
black . --line-length=128
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
add: '*.py'
author_name: GitHub Actions
author_email: [email protected]
message: "Formatted code with black."
default_author: github_actor
github_token: ${{ secrets.GITHUB_TOKEN }}
# -------- build --------
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
pip install --upgrade wheel
python -m build
- name: Install twine
run: pip install twine
- name: Check the distribution with twine
run: twine check dist/*
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
# -------- pypi --------
publish-to-pypi:
name: Publish Python 🐍 distribution πŸ“¦ to PyPI
needs:
- build
runs-on: ubuntu-20.04
environment:
name: pypi
url: https://pypi.org/p/MetricDB
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution πŸ“¦ to PyPI
uses: pypa/gh-action-pypi-publish@release/v1