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 64d01f8 commit 90a1e78
Showing 1 changed file with 48 additions and 12 deletions.
60 changes: 48 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,62 @@
name: Python package
name: CI for Cool-Graph

on: [push]
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
- name: Check out code
uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build a source tarball
if: startsWith(github.ref, 'refs/tags')
pip install -r requirements.txt
- name: Run tests
run: |
pipenv run python setup.py sdist
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
pytest
release:
runs-on: ubuntu-latest
needs: build

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

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
password: ${{ secrets.PYPI_API_TOKEN }}
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m twine upload dist/*

0 comments on commit 90a1e78

Please sign in to comment.