-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from mcvine/ci-conda-upload
github action: add a step to build and upload conda pkg
- Loading branch information
Showing
6 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
echo Windows build is not supported |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
let CORES=`grep -c ^processor /proc/cpuinfo` | ||
let CORES-=1 | ||
if ((CORES < 1)); then | ||
CORES = 1; | ||
fi | ||
|
||
PYVER_MAJOR=`python -c "from __future__ import print_function; import sys; print(sys.version_info[0])"` | ||
PYVER_MINOR=`python -c "from __future__ import print_function; import sys; print(sys.version_info[1])"` | ||
PYVER=${PYVER_MAJOR}.${PYVER_MINOR} | ||
echo $PYVER | ||
echo $PREFIX | ||
PY_INCLUDE_DIR=${PREFIX}/include/`ls ${PREFIX}/include/|grep python${PYVER}` | ||
PY_SHAREDLIB=${PREFIX}/lib/`ls ${PREFIX}/lib/|grep libpython${PYVER}[a-z]*.so$` | ||
echo $PY_INCLUDE_DIR | ||
echo $PY_SHAREDLIB | ||
|
||
mkdir build | ||
cd build | ||
cmake \ | ||
-DCONDA_BUILD=TRUE \ | ||
-DPYTHON_INCLUDE_DIR=${PY_INCLUDE_DIR} \ | ||
-DPYTHON_LIBRARY=${PY_SHAREDLIB} \ | ||
-DCMAKE_INSTALL_PREFIX=$PREFIX -DDEPLOYMENT_PREFIX=$PREFIX \ | ||
-DCMAKE_SYSTEM_LIBRARY_PATH=$PREFIX/lib \ | ||
.. \ | ||
&& make install |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# prerequisites | ||
# 1. in test conda environment | ||
# 2. in conda-recipe directory with meta.yaml.template | ||
# 3. defined env vars: | ||
# - PYTHON_VERSION | ||
# - _CONDA_PKG_NAME_ | ||
# - _CONDA_PKG_ARCH_ | ||
# - _CONDA_PKG_VER_ | ||
# - _GIT_REV_ | ||
# - CONDA_UPLOAD_TOKEN | ||
|
||
set -e | ||
set -x | ||
|
||
conda install -n root conda-build | ||
conda install anaconda-client | ||
which anaconda | ||
conda config --set anaconda_upload no | ||
|
||
# build | ||
cd $(realpath $(dirname $0)) | ||
pwd | ||
sed -e "s|XXXVERSIONXXX|$_CONDA_PKG_VER_|g" meta.yaml.template | sed -e "s|XXXGIT_REVXXX|$_GIT_REV_|g" > meta.yaml | ||
cat meta.yaml | ||
conda build --python=$PYTHON_VERSION . | ||
|
||
# upload | ||
CONDA_ROOT_PREFIX=$(realpath $(dirname `which conda`)/..) | ||
anaconda -t $CONDA_UPLOAD_TOKEN upload --force --label unstable \ | ||
$CONDA_ROOT_PREFIX/conda-bld/$_CONDA_PKG_ARCH_/$_CONDA_PKG_NAME_-$_CONDA_PKG_VER_-*.tar.bz2 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package: | ||
name: mcvine.phonon | ||
version: XXXVERSIONXXX | ||
|
||
source: | ||
git_rev: XXXGIT_REVXXX | ||
git_url: https://github.com/mcvine/phonon.git | ||
|
||
requirements: | ||
build: | ||
- {{ compiler('cxx') }} 7 # [linux] | ||
- cmake | ||
|
||
host: | ||
- python | ||
|
||
run: | ||
- python | ||
- mcvine-core >=1.4 | ||
|
||
build: | ||
noarch: python | ||
|
||
test: | ||
imports: | ||
- mcvine.phonon | ||
|
||
about: | ||
home: | ||
license: | ||
license_file: |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
export _GIT_REV_=`git describe --tags` | ||
VERSION=`git describe --tags | cut -d '-' -f1 | cut -c2-` | ||
VERSION_NEXT=`echo ${VERSION}| awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}'` | ||
echo ${VERSION} ${VERSION_NEXT} | ||
export _CONDA_PKG_VER_=${VERSION_NEXT}.dev | ||
export _CONDA_PKG_ARCH_=noarch | ||
export _CONDA_PKG_NAME_=mcvine.phonon | ||
echo building ${_CONDA_PKG_ARCH_} conda pkg ${_CONDA_PKG_NAME_} version:${_CONDA_PKG_VER_} git version:${_GIT_REV_} | ||
./builders/conda-recipe/create_conda_pkg.sh |