Skip to content

Commit

Permalink
Separate pypi and conda releases
Browse files Browse the repository at this point in the history
Since tar.gz not avaiable til finishes the release, the 2 build steps have been separated.
  • Loading branch information
szlaura committed Nov 20, 2024
1 parent bc0158c commit 7bc5594
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 79 deletions.
76 changes: 0 additions & 76 deletions .github/workflows/release.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/release_conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Conda Release

on:
workflow_run:
workflows: ["PyPI Release"]
types:
- completed

jobs:
conda-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Conda environment
uses: s-weigand/setup-conda@v1
with:
python-version: '3.11'

- name: Install Conda dependencies
run: |
set -e
conda install -y anaconda-client conda-build conda-verify conda-libmamba-solver
conda config --set solver libmamba
conda config --set channel_priority flexible
- name: Build Conda package
run: |
set -e
cd conda
conda build --user szlaura --token $ANACONDA_API_TOKEN --override-channels -c defaults -c conda-forge -c colomoto .
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/release_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PyPI Release

on:
release:
types: [published]

jobs:
pypi-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Extract version from tag and update files
run: |
set -e
sed -i "s:9999:${VERSION//*v/}:" setup.py conda/meta.yaml
echo "Version set successfully in setup.py and conda/meta.yaml"
env:
VERSION: ${{ github.ref }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install PyPI dependencies
run: |
set -e
python -m pip install --upgrade pip setuptools wheel twine
- name: Build and publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
set -e
python setup.py sdist bdist_wheel
twine upload dist/*
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "pydruglogics" %}
{% set version = environ.get('VERSION', '0.1.7') %}
{% set version = environ.get('VERSION', '0.1.8') %}

package:
name: {{ name|lower }}
Expand Down
2 changes: 1 addition & 1 deletion pydruglogics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
logger = logging.getLogger(__name__)


__version__ = "0.1.7"
__version__ = "0.1.8"

__all__ = [
"Perturbation",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="pydruglogics",
version="0.1.7",
version="0.1.8",
author="Laura Szekeres",
author_email="szekereslaura98@gmail.com",
description="PyDrugLogics: a Python package designed for constructing, optimizing Boolean models and performs in-silico perturbations of the models.",
Expand Down

0 comments on commit 7bc5594

Please sign in to comment.