Skip to content

Commit

Permalink
Merge branch 'main' of github.com:CartoDB/raster-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
giancastro committed Jan 5, 2023
2 parents 159980a + 1e0bbfa commit 863a9c1
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish package to PyPI
on:
push:
tags:
- '*'
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Get release version
run: |
echo "CHANGELOG_VERSION=$(cat CHANGELOG.md | grep -oP '(?<=##\s)(.*)(?=\])' | head -n 1 | sed 's/\[/v/g')" >> $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 build
- name: Get all git tags
run: git fetch --tags -f
- name: Build package
run: |
python -m build --sdist --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 }}

0 comments on commit 863a9c1

Please sign in to comment.