From f54e4daf8e717bceea711dc3e2f82f58e2aeb73f Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Tue, 27 Aug 2024 12:16:11 +0200 Subject: [PATCH] [CI] converted to GH workflow --- .drone.yml | 46 ----------------------------------- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++ .gitignore | 1 + README.md | 2 +- setup.py | 6 ++--- 5 files changed, 37 insertions(+), 51 deletions(-) delete mode 100644 .drone.yml create mode 100644 .github/workflows/publish.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 93f873b..0000000 --- a/.drone.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -kind: pipeline -name: publish_dev - -trigger: - branch: - - main - event: - exclude: - - pull_request - - tag - - promote - - rollback - -steps: -- name: pypi_publish - image: plugins/pypi - settings: - username: - from_secret: pypi_username - password: - from_secret: pypi_password - distributions: - - sdist - - bdist_wheel - ---- -kind: pipeline -name: publish - -trigger: - event: - include: - - tag - -steps: -- name: pypi_publish - image: plugins/pypi - settings: - username: - from_secret: pypi_username - password: - from_secret: pypi_password - distributions: - - sdist - - bdist_wheel diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..62fff1c --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Publish To PyPI + +on: + push: + branches: ['main'] + +jobs: + build-publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set environnment package version from commit + run: echo "PACKAGE_VERSION=v0.0.0-$(date +%Y%m%d)-${{ github.sha }}" >> $GITHUB_ENV # use same convention as Go bindings + + - name: Set up Python 3.12 + uses: actions/setup-python@v3 + with: + python-version: "3.12" + + - name: Install dependencies + run: pip install build twine + + - name: Build wheel + run: python -m build + + - name: Publish distribution to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: twine upload --repository pypi dist/* + diff --git a/.gitignore b/.gitignore index 398c4e5..f519085 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dist/ *.eggs/ *.egg-info/ *.egg +*.pyc diff --git a/README.md b/README.md index f570276..669ca54 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# CS3APIS for Python +# CS3APIs Bindings for Python [![Join the conversation](https://badges.gitter.im/cs3org/CS3APIS.svg)](https://gitter.im/cs3org/CS3APIS) [![Latest Version](https://img.shields.io/pypi/v/cs3apis)](https://pypi.org/project/cs3apis/) [![Drone CI Build Status](https://img.shields.io/drone/build/cs3org/python-cs3apis)](https://cloud.drone.io/cs3org/python-cs3apis) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) diff --git a/setup.py b/setup.py index f4f5efa..d08f800 100644 --- a/setup.py +++ b/setup.py @@ -5,13 +5,11 @@ setuptools.setup( name="cs3apis", - use_scm_version={ - "local_scheme": "no-local-version" - }, + version="PYPI_VERSION", setup_requires=['setuptools_scm'], author="CS3 Organization", author_email="contact@cs3community.org", - description="CS3 API client for Python", + description="CS3 API bindings for Python", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/cs3org/python-cs3apis",