From 094c7d659d64f08242e97e71440e023c32d0bca8 Mon Sep 17 00:00:00 2001 From: Nikolaus Sonnenschein Date: Tue, 12 Oct 2021 16:24:27 +0200 Subject: [PATCH] chore: use official pypi GH action and pypi API token --- .github/workflows/main.yml | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3d4ee134..31f5d749 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,28 +61,12 @@ jobs: python-version: [3.8] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + - name: Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 with: - python-version: ${{ matrix.python-version }} - - name: Get tag - id: tag - run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}" - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - python -m pip install twine - - name: Build package - run: python setup.py sdist bdist_wheel - - name: Check the package - run: twine check dist/* - - name: Publish to PyPI - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: - twine upload --verbose -u TWINE_USERNAME -p TWINE_PASSWORD --skip-existing --non-interactive dist/* + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} - name: Create GitHub release uses: actions/create-release@v1 env: