From e69a00e1145bb4042bee5dc85c4a0577c1967b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= Date: Wed, 10 Jan 2024 08:23:27 +0100 Subject: [PATCH 1/2] [Python] Add workflow for releasing to Pypi Also use setuptools instead of the deprecated distutils. --- .github/workflows/release-pypi.yaml | 44 +++++++++++++++++++++++++++++ python/setup.py | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-pypi.yaml diff --git a/.github/workflows/release-pypi.yaml b/.github/workflows/release-pypi.yaml new file mode 100644 index 000000000..bce97e23b --- /dev/null +++ b/.github/workflows/release-pypi.yaml @@ -0,0 +1,44 @@ +name: Release Python + +on: + push: + branches: [release/*] + +jobs: + release: + name: Release + runs-on: ubuntu-latest + environment: Release + permissions: + id-token: write + defaults: + run: + working-directory: python + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Show Python version + run: python --version + + - name: Install Python package dependencies + run: | + python -m pip install -U pip setuptools wheel twine + pip install -e . + + - name: Build dist + run: python setup.py sdist bdist_wheel + + - name: Check dist + run: twine check dist/* + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: python/dist/ + skip-existing: true diff --git a/python/setup.py b/python/setup.py index 7624dcee3..8dc4c959a 100644 --- a/python/setup.py +++ b/python/setup.py @@ -1,5 +1,5 @@ # coding: utf-8 -from distutils.core import setup +from setuptools import setup setup(name="gherkin-official", packages=["gherkin", "gherkin.pickles", "gherkin.stream"], version="27.0.0", From 18d29304731ebf74025d90d085ab5c291f2b2cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= Date: Wed, 10 Jan 2024 08:29:45 +0100 Subject: [PATCH 2/2] Updated Changelog.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4287f068c..b3a8c2a7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt - [Java, JavaScript, PHP, Go, Ruby] Upgraded messages to v24 ### Added +- [Python] Added release workflow for releasing to Pypi ([#213](https://github.com/cucumber/gherkin/pull/213)) - (i18n) Added Vietnamese translation of "Rule" ## [27.0.0] - 2023-09-15