Skip to content

Commit

Permalink
publish workflow for PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianBeilschmidt committed Nov 27, 2023
1 parent ad27c35 commit 6e1f8c1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflows builds the library and publishes it on PyPI.

name: Build & Publish

on:
workflow_run:
workflows: [Test]
types: [completed]
branches: [main]

jobs:
publish:
name: Publish

runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.8"] # use lowest supported Python version

environment:
name: pypi
url: https://pypi.org/p/geoengine-openapi-client

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: geoengine_sys Python package
name: Test

on: [push, pull_request]

Expand All @@ -23,7 +23,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
# pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
# - name: Lint with flake8
Expand Down

0 comments on commit 6e1f8c1

Please sign in to comment.