Skip to content

Commit

Permalink
Uses GitHub Action for PyPI deployments
Browse files Browse the repository at this point in the history
Travis is running a too outdated setuptools version for deploying.
Also we can't seem to upgrade it. The deployment error was:
```
Traceback (most recent call last):
  File "setup.py", line 3, in <module>
    from setuptools import setup, find_namespace_packages
ImportError: cannot import name find_namespace_packages
InvalidDistribution: Cannot find file (or expand pattern): 'dist/*'
```
  • Loading branch information
AndreMiras committed Apr 19, 2020
1 parent 31a82d0 commit 5527d1e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 13 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PyPI release
on: [push]

jobs:
pypi:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --user --upgrade setuptools wheel
- name: Build
run: |
python setup.py sdist bdist_wheel
python setup_meta.py sdist bdist_wheel
- name: Publish package
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.1.0
with:
user: __token__
password: ${{ secrets.pypi_password }}
17 changes: 16 additions & 1 deletion .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Garden flower
name: Garden mapview
on: [push, pull_request]

jobs:
Expand Down Expand Up @@ -144,3 +144,18 @@ jobs:
git add .
git commit -a -m "Docs for git-$GITHUB_SHA"
git push origin gh-pages -f
pypi:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Publish package
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.1.0
with:
user: __token__
password: ${{ secrets.pypi_password }}
11 changes: 0 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,3 @@ install:

script:
- docker run -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix mapview-linux /bin/sh -c 'tox'

# Deploy to PyPI using token set in `PYPI_PASSWORD` environment variable
# https://pypi.org/manage/account/token/
# https://travis-ci.com/github/kivy-garden/mapview/settings
deploy:
provider: pypi
distributions: sdist bdist_wheel
user: "__token__"
on:
tags: true
repo: kivy-garden/mapview
2 changes: 1 addition & 1 deletion kivy_garden/mapview/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.2.dev0'
__version__ = '1.0.2'

0 comments on commit 5527d1e

Please sign in to comment.