From 7cfbab8231e676a6243c4ea4dffc28c3d429f9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Cipri=C3=A0?= Date: Fri, 6 Sep 2024 11:47:10 +0200 Subject: [PATCH] chore: Update package.yml workflow configuration --- .github/workflows/package.yml | 73 +++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 515c951..d7cd830 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -3,7 +3,7 @@ name: Python Package Build and Publish on: push: tags: - - "v*" + - 'v*' workflow_dispatch: jobs: @@ -11,45 +11,52 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.x" + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' - - name: Install build tools - run: | - python -m pip install --upgrade pip - python -m pip install setuptools wheel + - name: Install build tools + run: | + python -m pip install --upgrade pip + python -m pip install setuptools wheel - - name: Build the package - run: | - python setup.py sdist bdist_wheel + - name: Build the package + run: | + python setup.py sdist bdist_wheel - - name: Check dist folder - run: ls -l dist + - name: Check dist folder + run: ls -l dist - - name: Upload build artifacts - uses: actions/upload-artifact@v3 - with: - name: dist - path: dist/ + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist/ publish: needs: build runs-on: ubuntu-latest steps: - - name: Download artifact - uses: actions/download-artifact@v3 - with: - name: dist - - - name: Publish to PyPI - env: - TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} - TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - run: | - python -m pip install --upgrade twine - twine upload dist/* + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: dist + path: ./dist # Ensure the dist directory is created locally + + - name: Check working directory + run: pwd + + - name: Check dist folder + run: ls -l dist + + - name: Publish to PyPI + env: + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + run: | + python -m pip install --upgrade twine + twine upload ./dist/*