Update publish pipeline

This commit is contained in:
Alex Root Junior 2023-07-17 22:57:31 +03:00
parent fcf9454e13
commit 71e7e62e36
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC

View file

@ -12,13 +12,20 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- name: Install build dependencies
run: python -m pip install --upgrade build
run: python -m pip install --upgrade build hatch
- name: Resolve version
id: package-version
run: echo "value=$(echo ${{ github.ref }} | sed -e 's/refs\/tags\/v//')" >> $GITHUB_OUTPUT
- name: Bump version
run: hatch version ${{ steps.package-version.outputs.value }}
- name: Build source distribution
run: python -m build .
@ -40,8 +47,12 @@ jobs:
publish:
name: Publish
needs: build
if: "success() && startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/aiogram/${{ steps.package-version.outputs.value }}/
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v1
@ -49,17 +60,5 @@ jobs:
name: dist
path: dist
# - name: Publish a Python distribution to Test PyPI
# uses: pypa/gh-action-pypi-publish@master
## if: github.event.action != 'published'
# with:
# user: __token__
# password: ${{ secrets.PYPI_TEST_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
# if: github.event.action == 'published'
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
uses: pypa/gh-action-pypi-publish@release/v1