diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..808568c7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release Python package + +on: + workflow_run: + workflows: [tests] + branches: [main] + types: [completed] + +jobs: + release: + needs: test + runs-on: ubuntu-latest + name: Release package to PyPi + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@master + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox tox-gh-actions + - name: Build and release 📦 to PyPI + with: + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + run: | + tox -e release + diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 02c34c09..ccb7e478 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,7 @@ on: - push jobs: - build: + test: runs-on: ubuntu-latest name: Docker | GDAL=${{ matrix.gdal-version }} | python=${{ matrix.python-version }} container: osgeo/gdal:ubuntu-full-${{ matrix.gdal-version }} @@ -45,9 +45,10 @@ jobs: python -m pip install tox tox-gh-actions - name: Lint with tox run: tox -e lint - # - name: Format with tox - # run: tox -e format + - name: Format with tox + run: tox -e format - name: Flake8 with tox run: tox -e flake8 - name: Test with tox run: tox -e test +