1- name : CI/CD for Cool-Graph
1+ name : Publish to PyPI
22
33on :
4- push :
5- branches :
6- - main
7- pull_request :
8- branches :
9- - main
104 release :
115 types : [published]
126
137jobs :
14- build :
8+ publish :
159 runs-on : ubuntu-latest
1610
1711 steps :
@@ -21,38 +15,15 @@ jobs:
2115 - name : Set up Miniconda
2216 uses : conda-incubator/setup-miniconda@v2
2317 with :
24- auto-activate-base : true
18+ auto-activate-base : false
2519 python-version : 3.8
2620
27- - name : Create and activate environment
21+ - name : Create and activate Conda environment
2822 shell : bash -l {0}
2923 run : |
3024 conda env create --file environment.yml --name cool-graph-env
31- source activate cool-graph-env
32- # Ensure recent versions of pip, setuptools, and install build and twine
33- python -m pip install --upgrade pip setuptools wheel
34- python -m pip install build twine
35-
36- release :
37- runs-on : ubuntu-latest
38- needs : build
39-
40- steps :
41- - name : Check out code
42- uses : actions/checkout@v2
43-
44- - name : Set up Miniconda
45- uses : conda-incubator/setup-miniconda@v2
46- with :
47- auto-activate-base : true
48- python-version : 3.8
49-
50- - name : Create and activate environment
51- shell : bash -l {0}
52- run : |
53- conda env create --file environment.yml --name cool-graph-env
54- source activate cool-graph-env
55- # Ensure recent versions of pip, setuptools, and install build and twine
25+ source $(conda info --base)/etc/profile.d/conda.sh
26+ conda activate cool-graph-env
5627 python -m pip install --upgrade pip setuptools wheel
5728 python -m pip install build twine
5829
6233 TWINE_USERNAME : __token__
6334 TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
6435 run : |
65- source activate cool-graph-env
36+ source $(conda info --base)/etc/profile.d/conda.sh
37+ conda activate cool-graph-env
6638 python -m build
6739 python -m twine upload dist/*
0 commit comments