Skip to content

remove Python 3.7 support in setup.py #206

remove Python 3.7 support in setup.py

remove Python 3.7 support in setup.py #206

Workflow file for this run

name: Publish Python package to PyPI / Test PyPI
on:
push:
branches:
- "**"
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-publish:
runs-on: ubuntu-22.04
name: Build a Python package and upload it to PyPI / Test PyPI
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: "pipenv"
- name: Install pipenv
run: |
python -m pip install --upgrade pip pipenv
python --version; python -m pip --version; pipenv --version
- name: Setup project with pipenv
run: |
pipenv --python 3.9 install --dev
- name: Build a Python package
run: |
pipenv run build
- name: Archive the built Python package
uses: actions/upload-artifact@v3
with:
name: smartmeter-datacollector-py
path: dist/*
- name: Publish the Python package to Test PyPI
if: github.ref == 'refs/heads/master'
uses: pypa/[email protected]
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish the Python package to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Get the tag name
id: tag-name
if: startsWith(github.ref, 'refs/tags')
uses: olegtarasov/[email protected]
- name: Create a new release
if: startsWith(github.ref, 'refs/tags')
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifacts: dist/*.tar.gz,dist/*.whl
draft: true
name: Smart Meter Data Collector ${{ steps.tag-name.outputs.tag }}
omitBody: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}