Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish package to PyPI
on:
push:
tags:
- '*'
jobs:
publish:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Get release version
run: |
echo "CHANGELOG_VERSION=$(cat CHANGELOG.md | grep -oP '(?<=###\s)(.*)(?=\s\-)' | head -n 1 | sed 's/Version\s/v/')" >> $GITHUB_ENV
echo "TAG_VERSION=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
- name: Check changelog release version
if: ${{ env.TAG_VERSION != env.CHANGELOG_VERSION }}
run: |
echo "CHANGELOG_VERSION($CHANGELOG_VERSION) is different from TAG_VERSION($TAG_VERSION)"
exit 1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyct \
wheel \
setuptools
- name: Get all git tags
run: git fetch --tags -f
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Get package size
run: echo "PKG_SIZE=$(find dist -maxdepth 1 -regex '.*gz' | xargs stat --format='%s')" >> $GITHUB_ENV
- name: Check package size
if: ${{ env.PKG_SIZE > 1e+8 }}
run: |
echo "PKG_SIZE($PKG_SIZE bytes) is greater than 100MB"
exit 1
- name: Publish package
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
skip_existing: true
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
'jinja2',
'spatialpandas',
'pytest',
'tbb',
'rtree',
'rioxarray',
'matplotlib',
Expand Down