Skip to content

Commit c3ca1ab

Browse files
authored
Update main.yml
1 parent 41b7abf commit c3ca1ab

File tree

1 file changed

+39
-11
lines changed

1 file changed

+39
-11
lines changed

.github/workflows/main.yml

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,66 @@
1-
name: Publish to PyPI
1+
name: CI/CD for Cool-Graph
22

33
on:
4+
push:
5+
branches:
6+
- develop
7+
pull_request:
8+
branches:
9+
- develop
410
release:
511
types: [published]
612

713
jobs:
8-
publish:
14+
build:
915
runs-on: ubuntu-latest
1016

1117
steps:
1218
- name: Check out code
13-
uses: actions/checkout@v3
19+
uses: actions/checkout@v2
1420

1521
- name: Set up Miniconda
1622
uses: conda-incubator/setup-miniconda@v2
1723
with:
1824
auto-activate-base: false
1925
python-version: 3.8
20-
environment-file: environment.yml
21-
activate-environment: cool-graph-env
2226

23-
- name: Install build tools and dependencies
27+
- name: Create and activate environment
28+
shell: bash -l {0}
2429
run: |
25-
source $(conda info --base)/etc/profile.d/conda.sh
26-
conda activate cool-graph-env
27-
python -m pip install --upgrade pip setuptools wheel
28-
python -m pip install build twine
30+
conda env create --file environment.yml --name cool-graph-env
31+
echo "Environment created"
32+
echo "source $(conda info --base)/etc/profile.d/conda.sh" >> $GITHUB_ENV
33+
echo "conda activate cool-graph-env" >> $GITHUB_ENV
34+
35+
release:
36+
runs-on: ubuntu-latest
37+
needs: build
38+
39+
steps:
40+
- name: Check out code
41+
uses: actions/checkout@v2
42+
43+
- name: Set up Miniconda
44+
uses: conda-incubator/setup-miniconda@v2
45+
with:
46+
auto-activate-base: false
47+
python-version: 3.8
48+
49+
- name: Create and activate environment
50+
shell: bash -l {0}
51+
run: |
52+
conda env create --file environment.yml --name cool-graph-env
53+
echo "Environment created"
54+
echo "source $(conda info --base)/etc/profile.d/conda.sh" >> $GITHUB_ENV
55+
echo "conda activate cool-graph-env" >> $GITHUB_ENV
2956
3057
- name: Build and publish package
58+
shell: bash -l {0}
3159
env:
3260
TWINE_USERNAME: __token__
3361
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
3462
run: |
3563
source $(conda info --base)/etc/profile.d/conda.sh
3664
conda activate cool-graph-env
3765
python -m build
38-
python -m twine upload dist/* --verbose
66+
python -m twine upload dist/*

0 commit comments

Comments
 (0)