Skip to content

Update main.yml

Update main.yml #34

Workflow file for this run

name: CI/CD for Cool-Graph
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: true
python-version: 3.8
- name: Create and activate environment
shell: bash -l {0}
run: |
conda env create --file environment.yml --name cool-graph-env
conda activate cool-graph-env
# Ensure recent versions of pip and setuptools
python -m pip install --upgrade pip setuptools wheel twine
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: true
python-version: 3.8
- name: Create and activate environment
shell: bash -l {0}
run: |
conda env create --file environment.yml --name cool-graph-env
conda activate cool-graph-env
python -m pip install --upgrade pip setuptools wheel twine
- name: Build and publish package
shell: bash -l {0}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
conda activate cool-graph-env
python -m build
python -m twine upload dist/*