From 1f6eb6c8b4d245f0b9909ac5da085732e9081629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Thu, 22 Feb 2024 15:30:26 +0100 Subject: [PATCH 1/2] Setup workflow to publish on PyPI.org --- .github/workflows/black.yml | 2 +- .github/workflows/publish.yml | 45 +++++++++++++++++++---------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index b04fb15..81e6a94 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -6,5 +6,5 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: psf/black@stable diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 43de898..6c0ace9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,29 +1,32 @@ -name: Build and upload Python Package to pypi.autoactuary.com +name: Build and publish release on: release: types: [created] jobs: - deploy: - + pypi-publish: + name: Upload release to PyPI + if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest - + environment: + name: pypi + url: https://pypi.org/p/mkdocstrings-vba + permissions: + id-token: write steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: 'aa' - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - TWINE_REPOSITORY_URL: 'https://pypi.autoactuary.com' - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build distributions + run: | + python -m pip install build + python -m build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 From d4485ab069a0e588a5a96ff6ddee5b269c879c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Thu, 22 Feb 2024 15:35:42 +0100 Subject: [PATCH 2/2] fixup! Setup workflow to publish on PyPI.org --- .github/workflows/publish.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6c0ace9..6924913 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,8 +1,6 @@ name: Build and publish release -on: - release: - types: [created] +on: push jobs: pypi-publish: @@ -23,10 +21,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build distributions - run: | python -m pip install build - python -m build + - name: Build distributions + run: python -m build - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1