diff --git a/.github/workflows/build-and-release-py2.yml b/.github/workflows/build-and-release-py2.yml index 2f16c7f..36a24be 100644 --- a/.github/workflows/build-and-release-py2.yml +++ b/.github/workflows/build-and-release-py2.yml @@ -1,6 +1,8 @@ name: test (python 2.7) on: + push: + branches: [master] pull_request: branches: [master] diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 021940c..e26345a 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -1,4 +1,4 @@ -name: test and bump +name: test, bump and publish on: push: @@ -78,4 +78,42 @@ jobs: run: | sha_new=$(git rev-parse HEAD) echo $sha_new - echo "::set-output name=SHA::$sha_new" \ No newline at end of file + echo "::set-output name=SHA::$sha_new" + + publish: + needs: bump + if: ${{ github.event_name == 'push' }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ needs.bump.outputs.new_sha }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install python dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools twine wheel coveralls + pip install -e .[all] + + - name: Show python dependencies + run: | + pip freeze + + - name: Build package + run: | + mkdir clean-build + python setup.py sdist bdist_wheel --universal --dist-dir ./clean-build + + - name: Publish package + uses: pypa/gh-action-pypi-publish@v1.3.1 + with: + user: __token__ + password: ${{ secrets.pypi_token }} + packages_dir: clean-build/