diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7d42c78..9c893f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,49 +1,31 @@ -name: Publish to PyPI -on: - push: - tags: - - '*' - -jobs: - pypi-publish: - name: Upload release to PyPI - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 +=name: Upload Python Package to PyPI - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 +on: + release: + types: [published] - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade setuptools wheel - pip install --upgrade twine +permissions: + contents: read - - name: Build and publish wheel - run: | - python -m build - twine upload dist/*.whl +jobs: + deploy: - build: - name: Build distribution runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade setuptools wheel - pip install --upgrade twine - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}