From 522fbdaa9c4d1ea82a6f3725e7f30f661673edac Mon Sep 17 00:00:00 2001 From: Marcus Ottosson Date: Tue, 27 Feb 2024 17:15:52 +0000 Subject: [PATCH] Update distribution method --- .github/workflows/main.yml | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 21b7b08..33a852f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,26 +86,29 @@ jobs: path: ./build/html deploy: + name: Build and Release runs-on: ubuntu-latest if: contains(github.ref, 'refs/tags/') - needs: maya + + environment: + name: pypi + url: https://pypi.org/p/cmdx + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + 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: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.7.x" + - name: Install build dependency + run: python3 -m pip install --upgrade build + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Release to PyPi + uses: pypa/gh-action-pypi-publish@release/v1 docs: runs-on: ubuntu-latest