From c369357cb0f2d979872b29c24de2de256436238a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Weber?= Date: Fri, 26 Jan 2024 23:01:38 +0100 Subject: [PATCH] Update python-publish.yml --- .github/workflows/python-publish.yml | 46 +++++++++------------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 92e8cab..7b4090c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -8,7 +8,7 @@ on: types: [created] jobs: - build: + deploy: runs-on: ubuntu-latest @@ -17,37 +17,21 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install hatch hatchling - - name: Build - run: hatch build - - name: Store the distribution packages - uses: actions/upload-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - publish-to-pypi: - name: >- - Publish Python 🐍 distribution 📦 to PyPI - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes - needs: - - build - runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/ # Replace with your PyPI project name - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing + pip install setuptools wheel twine toml "pymodaq>=4.1.0" pyqt5 - steps: - - name: Download all the dists - uses: actions/download-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file + - name: create local pymodaq folder and setting permissions + run: | + sudo mkdir /etc/.pymodaq + sudo chmod uo+rw /etc/.pymodaq + + - 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/*