diff --git a/.github/workflows/pypi_release.yml b/.github/workflows/pypi_release.yml index cbabd12..a2aeaa2 100644 --- a/.github/workflows/pypi_release.yml +++ b/.github/workflows/pypi_release.yml @@ -5,46 +5,31 @@ name: Pypi Release -on: +on: release: types: [created] jobs: - build: - name: Build distribution - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - name: Install Dependency - run: python -m pip install -U build - - name: Build Distribution Pakcage - run: python -m build - - name: Store the distribution packages - uses: actions/upload-artifact@v4 - with: - name: python-package-distributions - path: dist/ + deploy: - publish-to-pypi: - name: Publish to PyPI - needs: - - build runs-on: ubuntu-latest - environment: - name: pypi steps: - - name: Download all the dists - uses: actions/download-artifact@v4 - with: - name: python-package-distributions - path: dist/ - - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: - username: __token__ - password: ${{ secrets.PYPI_TOKEN }} \ No newline at end of file + python-version: '3.10' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets. PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets. PYPI_PASSWORD }} + RELEASE: 1 + + run: | + python -m build + twine upload dist/* --verbose