Skip to content

Commit

Permalink
PKG generalize
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Jul 10, 2019
1 parent 0d0c108 commit 025cdb0
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,48 @@

## Define the release

PACKAGE=apstools
PACKAGE=`python setup.py --name`
RELEASE=`python setup.py --version`
echo "PACKAGE: ${PACKAGE}"
echo "RELEASE: ${RELEASE}"

if [[ ${RELEASE} == *dirty || ${RELEASE} == *+* ]] ; then
echo "version: ${RELEASE} not ready to publish"
exit 1
fi

## PyPI Build and upload::

echo "Building for upload to PyPI"
python setup.py sdist bdist_wheel
twine upload dist/${PACKAGE}-${RELEASE}*

## Conda Build and upload::

### Conda channels

# `aps-anl-tag` production releases
# `aps-anl-dev` anything else, such as: pre-release, release candidates, or testing purposes
CHANNEL=aps-anl-tag
if [[ ${RELEASE} == *rc* ]] ; then
# anything else, such as: pre-release, release candidates, or testing purposes
CHANNEL=aps-anl-dev
else
# production releases
CHANNEL=aps-anl-tag
fi

### publish (from linux)

echo "Building for upload to conda"

### publish
export CONDA_BLD_PATH=/tmp/conda-bld
/bin/mkdir -p ${CONDA_BLD_PATH}

conda build ./conda-recipe/
CONDA_BASE=`conda info --base`
BUILD_DIR=${CONDA_BASE}/conda-bld/noarch
anaconda upload -u ${CHANNEL} ${BUILD_DIR}/${PACKAGE}-${RELEASE}-py_0.tar.bz2
BUILD_DIR=${CONDA_BLD_PATH}/noarch
_package_=$(echo ${PACKAGE} | tr '[:upper:]' '[:lower:]')
BUNDLE=${BUILD_DIR}/${_package_}-${RELEASE}-*_0.tar.bz2
echo "upload to conda"
echo "CHANNEL: ${CHANNEL}"
anaconda upload -u ${CHANNEL} ${BUNDLE}

# also post to my personal channel
anaconda upload ${BUNDLE}

0 comments on commit 025cdb0

Please sign in to comment.