From 869ec0207c86f17b4c19eb07685ccdf3bc7fb78b Mon Sep 17 00:00:00 2001 From: Maximiliano Greco Date: Tue, 18 Jan 2022 18:56:12 +0100 Subject: [PATCH] cicd: add build process --- .github/workflows/python-package.yml | 19 +++++++++++++++++++ MANIFEST.in | 6 +----- Makefile | 4 ++++ setup.cfg | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 7997917..dd84f89 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -25,3 +25,22 @@ jobs: run: make lint - name: Test with pytest run: make test + dist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup venv + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: actions/setup-python@v2 + with: + python-version: "3.9" + run: make venv + - name: Build package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + run: make build + - name: Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/MANIFEST.in b/MANIFEST.in index 5eac3d8..70d6c72 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,3 @@ # file GENERATED by distutils, do NOT edit -setup.cfg -setup.py -ineqpy/__init__.py -ineqpy/ineqpy.py include versioneer.py -include ineqpy/_version.py +include src/ineqpy/_version.py diff --git a/Makefile b/Makefile index 709ead2..95f832d 100644 --- a/Makefile +++ b/Makefile @@ -27,3 +27,7 @@ doc: .PHONY: vim vim: pipenv run nvim . + +.PHONY: build +build: + pipenv run python setup.py sdist bdist_wheel diff --git a/setup.cfg b/setup.cfg index 766fdaa..8f4d54d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,6 +4,6 @@ description-file = README.rst [versioneer] VCS = git style = pep440 -versionfile_source = ineqpy/_version.py +versionfile_source = src/ineqpy/_version.py versionfile_build = ineqpy/_version.py tag_prefix = ineqpy-