Skip to content

Commit

Permalink
create virtual environment in build_deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
zchmielewska committed Oct 16, 2024
1 parent 59216ed commit 9702513
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ jobs:
with:
python-version: "3.11"

- name: Install dependencies
- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install setuptools
python -m pip install Cython
python -m pip install numpy
- name: Build Cython extensions
run: python setup.py build_ext --inplace
run: |
source venv/bin/activate
python setup.py build_ext --inplace
make_sdist:
needs: build_extension
Expand All @@ -35,14 +39,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install Cython
python -m pip install numpy
- name: Build source distribution
run: python setup.py sdist
run: |
source venv/bin/activate
python setup.py sdist
- uses: actions/upload-artifact@v3
with:
Expand All @@ -59,8 +67,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install dependencies
- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install Cython
python -m pip install numpy
Expand All @@ -85,8 +95,17 @@ jobs:
name: artifact
path: dist

- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
run: |
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install twine
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 9702513

Please sign in to comment.