Skip to content

Commit

Permalink
Update python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
seb5g authored Jan 26, 2024
1 parent e08adae commit c369357
Showing 1 changed file with 15 additions and 31 deletions.
46 changes: 15 additions & 31 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
types: [created]

jobs:
build:
deploy:

runs-on: ubuntu-latest

Expand All @@ -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/<package-name> # Replace <package-name> 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
- 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/*

0 comments on commit c369357

Please sign in to comment.