Skip to content

Commit

Permalink
adding actions ci for the library build
Browse files Browse the repository at this point in the history
  • Loading branch information
dkazanc committed Aug 12, 2024
1 parent 4c60a87 commit 0cfa4fc
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 6 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/libtomophantom_conda_upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: libtomophantom_conda_upload

on: [push]

jobs:
build-linux:
runs-on: ubuntu-20.04

defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository code
uses: actions/checkout@v4
with:
ref: "master"
fetch-depth: 0

# setup Python 3.11
- name: Setup Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install dependencies with Conda
run: |
$CONDA/bin/conda install -c conda-forge conda-build anaconda-client
$CONDA/bin/conda install -c conda-forge cmake
$CONDA/bin/conda update conda
$CONDA/bin/conda update conda-build
$CONDA/bin/conda list
- name: Decrypt a secret
run: ./.scripts/decrypt_secret.sh
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

- name: Upload the tested package to conda cloud
run: |
chmod +x ./.scripts/conda_upload_lib.sh
./.scripts/conda_upload_lib.sh
10 changes: 5 additions & 5 deletions .github/workflows/tomophantom_conda_upload.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tomohantom_conda_upload
name: tomophantom_conda_upload

on: [push]

Expand All @@ -12,16 +12,16 @@ jobs:

steps:
- name: Checkout repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: "master"
fetch-depth: 0

# setup Python 3.9
- name: Setup Python 3.9
# setup Python 3.11
- name: Setup Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.11

- name: Install dependencies with Conda
run: |
Expand Down
2 changes: 1 addition & 1 deletion .scripts/conda_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mkdir ~/conda-bld
conda config --set anaconda_upload no
export CONDA_BLD_PATH=~/conda-bld

export CIL_VERSION=3.0
export CIL_VERSION=3.0.1
$CONDA/bin/conda build conda-recipe . -c httomo

# upload packages to conda
Expand Down
20 changes: 20 additions & 0 deletions .scripts/conda_upload_lib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

PKG_NAME=libtomophantom
USER=httomo-team
OS=noarch
CONDA_TOKEN=$(cat $HOME/.secrets/my_secret.json)

mkdir ~/conda-bld
conda config --set anaconda_upload no
export CONDA_BLD_PATH=~/conda-bld

export CIL_VERSION=3.0.1
$CONDA/bin/conda build conda-recipe_library . -c httomo

# upload packages to conda
find $CONDA_BLD_PATH/$OS -name *.tar.bz2 | while read file
do
echo $file
$CONDA/bin/anaconda -v --show-traceback --token $CONDA_TOKEN upload $file --force
done

0 comments on commit 0cfa4fc

Please sign in to comment.