Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dapavlik authored Feb 20, 2025
1 parent 2e92dcb commit 7b04aa9
Showing 1 changed file with 11 additions and 36 deletions.
47 changes: 11 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,39 @@ name: CI/CD for Cool-Graph
on:
push:
branches:
- main
pull_request:
branches:
- main
- main
release:
types: [published]

jobs:
build:
publish:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: false
python-version: 3.8
environment-file: environment.yml
activate-environment: cool-graph-env

- name: Create and activate environment
shell: bash -l {0}
- name: Install build tools and dependencies
run: |
conda env create --file environment.yml --name cool-graph-env
echo "Environment created"
echo "source $(conda info --base)/etc/profile.d/conda.sh" >> $GITHUB_ENV
echo "conda activate cool-graph-env" >> $GITHUB_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: false
python-version: 3.8

- name: Create and activate environment
shell: bash -l {0}
run: |
conda env create --file environment.yml --name cool-graph-env
echo "Environment created"
echo "source $(conda info --base)/etc/profile.d/conda.sh" >> $GITHUB_ENV
echo "conda activate cool-graph-env" >> $GITHUB_ENV
source $(conda info --base)/etc/profile.d/conda.sh
conda activate cool-graph-env
python -m pip install --upgrade pip setuptools wheel
python -m pip install build twine
- name: Build and publish package
shell: bash -l {0}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate cool-graph-env
python -m build
python -m twine upload dist/*
python -m twine upload dist/* --verbose

0 comments on commit 7b04aa9

Please sign in to comment.