Update main.yml #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 Conda environment | |
| shell: bash -l {0} | |
| run: | | |
| conda env create --file environment.yml --name cool-graph-env | |
| conda activate cool-graph-env | |
| 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 Conda environment | |
| shell: bash -l {0} | |
| run: | | |
| conda env create --file environment.yml --name cool-graph-env | |
| conda activate cool-graph-env | |
| - 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 setup.py sdist bdist_wheel | |
| python -m twine upload dist/* |