From c56b22d9ff229df004e6d3996421ad41b15f8ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= Date: Sat, 6 Jan 2024 20:28:56 +0100 Subject: [PATCH] Add release-pypi.yaml to relase to Pypi Remove the other release workflows to only release to Pypi --- .github/workflows/release-github.yaml | 18 ----------- .github/workflows/release-mvn.yml | 25 ---------------- .github/workflows/release-npm.yml | 24 --------------- .github/workflows/release-perl.yml | 19 ------------ .github/workflows/release-pypi.yaml | 43 +++++++++++++++++++++++++++ .github/workflows/release-rubygem.yml | 21 ------------- 6 files changed, 43 insertions(+), 107 deletions(-) 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-perl.yml create mode 100644 .github/workflows/release-pypi.yaml delete mode 100644 .github/workflows/release-rubygem.yml diff --git a/.github/workflows/release-github.yaml b/.github/workflows/release-github.yaml deleted file mode 100644 index 8030e412..00000000 --- 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@v4 - - uses: cucumber/action-create-github-release@v1.1.1 - 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 ce293fe5..00000000 --- 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@v4 - - 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 67d5a120..00000000 --- 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@v4 - - uses: actions/setup-node@v3 - with: - node-version: '17' - cache: 'npm' - cache-dependency-path: javascript/package-lock.json - - run: npm install-test - working-directory: javascript - - uses: cucumber/action-publish-npm@v1.1.1 - with: - npm-token: ${{ secrets.NPM_TOKEN }} - working-directory: javascript diff --git a/.github/workflows/release-perl.yml b/.github/workflows/release-perl.yml deleted file mode 100644 index 0be43cd6..00000000 --- a/.github/workflows/release-perl.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Publish to CPAN - -on: - push: - branches: - - "release/*" - -jobs: - publish-ui: - name: Publish to CPAN - runs-on: ubuntu-latest - environment: Release - steps: - - uses: actions/checkout@v4 - - uses: cucumber/action-publish-cpan@v1.0.1 - with: - cpan-user: ${{ secrets.CPAN_USER }} - cpan-password: ${{ secrets.CPAN_PASSWORD }} - working-directory: "perl" diff --git a/.github/workflows/release-pypi.yaml b/.github/workflows/release-pypi.yaml new file mode 100644 index 00000000..f5afed0d --- /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 0314b2b2..00000000 --- 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@v4 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.2' - bundler-cache: true - - uses: cucumber/action-publish-rubygem@v1.0.0 - with: - rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }} - working_directory: ruby