diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9343d1a40e0..b19b101c1b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,5 @@ name: Release -on: - release: - types: - - published +on: [push, pull_request, workflow_dispatch] jobs: release: @@ -16,16 +13,17 @@ jobs: with: python-version: '3.10' - name: Install dependencies - run: pip install -U pip wheel setuptools - - name: Build package - run: python setup.py sdist bdist_wheel + run: pip install -U pip build wheel setuptools + - name: Build distributions + run: python -m build - name: Upload package as artifact to GitHub - uses: actions/upload-artifact@v2 + if: github.repository == 'projectmesa/mesa' && startsWith(github.ref, 'refs/tags') + uses: actions/upload-artifact@v3 with: name: package path: dist/ - - name: Upload packages to PyPI + - name: Publish package to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 with: - user: __token__ - password: ${{ secrets.pypi_password }} + password: ${{ secrets.PYPI_API_TOKEN }}