From 92b627f41a3e298c5490f700d7a861595b55c030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= Date: Wed, 10 Jan 2024 08:06:34 +0100 Subject: [PATCH] Add workflow release-pypi.yaml Also remove the other release workflows to only release to Pypi --- .github/workflows/release-cpan.yaml | 20 ------------- .github/workflows/release-github.yaml | 18 ----------- .github/workflows/release-mvn.yml | 25 ---------------- .github/workflows/release-npm.yml | 24 --------------- .github/workflows/release-nuget.yaml | 22 -------------- .github/workflows/release-php.yaml | 21 ------------- .github/workflows/release-pypi.yaml | 43 +++++++++++++++++++++++++++ .github/workflows/release-rubygem.yml | 21 ------------- python/setup.py | 2 +- 9 files changed, 44 insertions(+), 152 deletions(-) delete mode 100644 .github/workflows/release-cpan.yaml delete mode 100644 .github/workflows/release-github.yaml delete mode 100644 .github/workflows/release-mvn.yml delete mode 100644 .github/workflows/release-npm.yml delete mode 100644 .github/workflows/release-nuget.yaml delete mode 100644 .github/workflows/release-php.yaml create mode 100644 .github/workflows/release-pypi.yaml delete mode 100644 .github/workflows/release-rubygem.yml diff --git a/.github/workflows/release-cpan.yaml b/.github/workflows/release-cpan.yaml deleted file mode 100644 index a96e20e38..000000000 --- a/.github/workflows/release-cpan.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Release Perl/CPAN - -on: - push: - branches: [release/*] - -jobs: - create-perl-release: - name: Publish to CPAN - runs-on: ubuntu-latest - environment: Release - permissions: - contents: write - steps: - - uses: actions/checkout@v3 - - uses: cucumber/action-publish-cpan@v1.0.0 - with: - cpan-user: ${{ secrets.CPAN_USER }} - cpan-password: ${{ secrets.CPAN_PASSWORD }} - working-directory: 'perl' diff --git a/.github/workflows/release-github.yaml b/.github/workflows/release-github.yaml deleted file mode 100644 index 88b128a59..000000000 --- a/.github/workflows/release-github.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: Release GitHub - -on: - push: - branches: [release/*] - -jobs: - create-github-release: - name: Create GitHub Release and Git tag - runs-on: ubuntu-latest - environment: Release - permissions: - contents: write - steps: - - uses: actions/checkout@v3 - - uses: cucumber/action-create-github-release@v1.1.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-mvn.yml b/.github/workflows/release-mvn.yml deleted file mode 100644 index 50f5ba889..000000000 --- a/.github/workflows/release-mvn.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Release Maven - -on: - push: - branches: [release/*] - -jobs: - publish-mvn: - name: Publish Maven Package - runs-on: ubuntu-latest - environment: Release - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '11' - cache: 'maven' - - uses: cucumber/action-publish-mvn@v2.0.0 - with: - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} - nexus-username: cukebot - nexus-password: ${{ secrets.SONATYPE_PASSWORD }} - working-directory: java diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml deleted file mode 100644 index b027774af..000000000 --- a/.github/workflows/release-npm.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Release NPM - -on: - push: - branches: [release/*] - -jobs: - publish-npm: - name: Publish NPM module - runs-on: ubuntu-latest - environment: Release - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '16' - cache: 'npm' - cache-dependency-path: javascript/package-lock.json - - run: npm install-test - working-directory: javascript - - uses: cucumber/action-publish-npm@v1.1.0 - with: - npm-token: ${{ secrets.NPM_TOKEN }} - working-directory: javascript diff --git a/.github/workflows/release-nuget.yaml b/.github/workflows/release-nuget.yaml deleted file mode 100644 index b638c6b83..000000000 --- a/.github/workflows/release-nuget.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Release NuGet - -on: - push: - branches: - - "release/*" - -jobs: - publish-nuget: - name: Publish package to NuGet.org - runs-on: ubuntu-latest - environment: Release - steps: - - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x - - uses: cucumber/action-publish-nuget@v1.0.0 - with: - nuget-api-key: ${{ secrets.NUGET_API_KEY }} - working-directory: "dotnet" diff --git a/.github/workflows/release-php.yaml b/.github/workflows/release-php.yaml deleted file mode 100644 index 5aa842ceb..000000000 --- a/.github/workflows/release-php.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Release PHP - -on: - push: - branches: [release/*] - -jobs: - publish-php-subrepo: - name: Publish to cucumber/gherkin-php subrepo - runs-on: ubuntu-latest - environment: Release - permissions: - contents: write - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: '0' - - uses: cucumber/action-publish-subrepo@v1.1.0 - with: - working-directory: php - github-token: ${{ secrets.CUKEBOT_GITHUB_TOKEN }} diff --git a/.github/workflows/release-pypi.yaml b/.github/workflows/release-pypi.yaml new file mode 100644 index 000000000..f5afed0d6 --- /dev/null +++ b/.github/workflows/release-pypi.yaml @@ -0,0 +1,43 @@ +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/ diff --git a/.github/workflows/release-rubygem.yml b/.github/workflows/release-rubygem.yml deleted file mode 100644 index 54149566c..000000000 --- a/.github/workflows/release-rubygem.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Release RubyGems - -on: - push: - branches: [release/*] - -jobs: - publish-rubygem: - name: Publish Ruby Gem - runs-on: ubuntu-latest - environment: Release - steps: - - uses: actions/checkout@v3 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.0.2' - bundler-cache: true - - uses: cucumber/action-publish-rubygem@v1.0.0 - with: - rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }} - working_directory: ruby diff --git a/python/setup.py b/python/setup.py index 22c5e58fb..f947472dd 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="26.0.3",