diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c6985e2..fc72986 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,13 +37,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_FLAG_NAME: ${{ matrix.python-version }} COVERALLS_PARALLEL: true - - name: Publish to PyPI - if: github.ref == 'refs/heads/master' && github.event_name == 'push' && matrix.python-version == '3.10' - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} - skip_existing: true coveralls: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ecfd805 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Python package +on: + push: + tags: + - "*.*.*" +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # If there isn't a release for this version, create a new one. + - uses: ncipollo/release-action@v1 + with: + generateReleaseNotes: true + makeLatest: true + prerelease: false + skipIfReleaseExists: true + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.10' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + pip install -e . + - name: Build and publish + env: + TWINE_USERNAME: "__token__" + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* \ No newline at end of file