-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (42 loc) · 1.66 KB
/
python-package-conda.yml
File metadata and controls
54 lines (42 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Python Package using Conda
on: [push]
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Conda build package and upload to anaconda.org
env:
ANACONDA_CHANNEL_UPLOAD_TOKEN: ${{ secrets.ANACONDA_CHANNEL_UPLOAD_TOKEN }}
run: |
set -euo pipefail
conda create -n test_dms_datastore -y conda-build conda-verify numpy anaconda-client
source $CONDA/etc/profile.d/conda.sh
conda activate test_dms_datastore
pip install setuptools_scm
git fetch --force --tags
echo "Describe: $(git describe --tags --dirty --always || true)"
PKG_VERSION=$(python -m setuptools_scm | sed 's/+/-/g')
echo "Building version: $PKG_VERSION"
if [ -z "$PKG_VERSION" ] || [ "$PKG_VERSION" = "0.0.0" ] || [ "$PKG_VERSION" = "None" ]; then
echo "ERROR: Bad PKG_VERSION='$PKG_VERSION'"
exit 1
fi
echo "PKG_VERSION: $PKG_VERSION" > conda.recipe/variant.yaml
cat conda.recipe/variant.yaml
conda config --set anaconda_upload yes
conda build -m conda.recipe/variant.yaml -c cadwr-dms -c conda-forge --user cadwr-dms --token "$ANACONDA_CHANNEL_UPLOAD_TOKEN" conda.recipe
conda deactivate
conda remove -n test_dms_datastore --all -y