Skip to content

Commit 472af9c

Browse files
EliEli
authored andcommitted
Switched version passing from environment to variant.yaml.
1 parent d5f295b commit 472af9c

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/python-package-conda.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,26 @@ jobs:
2929
conda create -n test_dms_datastore -y conda-build conda-verify numpy anaconda-client
3030
source $CONDA/etc/profile.d/conda.sh
3131
conda activate test_dms_datastore
32+
3233
pip install setuptools_scm
3334
3435
git fetch --force --tags
35-
echo "HEAD: $(git rev-parse HEAD)"
3636
echo "Describe: $(git describe --tags --dirty --always || true)"
3737
3838
PKG_VERSION=$(python -m setuptools_scm | sed 's/+/-/g')
3939
echo "Building version: $PKG_VERSION"
4040
41-
if [ -z "$PKG_VERSION" ] || [ "$PKG_VERSION" = "0.0.0" ]; then
42-
echo "ERROR: Bad PKG_VERSION='$PKG_VERSION' (missing tags or setuptools_scm failure)"
41+
if [ -z "$PKG_VERSION" ] || [ "$PKG_VERSION" = "0.0.0" ] || [ "$PKG_VERSION" = "None" ]; then
42+
echo "ERROR: Bad PKG_VERSION='$PKG_VERSION'"
4343
exit 1
4444
fi
4545
46+
echo "PKG_VERSION: $PKG_VERSION" > conda.recipe/variant.yaml
47+
cat conda.recipe/variant.yaml
48+
4649
conda config --set anaconda_upload yes
47-
PKG_VERSION=$PKG_VERSION conda build -c cadwr-dms -c conda-forge --user cadwr-dms --token "$ANACONDA_CHANNEL_UPLOAD_TOKEN" conda.recipe
50+
51+
conda build -m conda.recipe/variant.yaml -c cadwr-dms -c conda-forge --user cadwr-dms --token "$ANACONDA_CHANNEL_UPLOAD_TOKEN" conda.recipe
4852
4953
conda deactivate
5054
conda remove -n test_dms_datastore --all -y
51-

conda.recipe/meta.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
{% set python_version = pyproject['project']['requires-python'] %}
33
{% set setup_data = load_setup_py_data() %}
44

5+
6+
57
package:
68
name: dms-datastore
79
# Use the environment variable passed from the shell
810
# Set via: export PKG_VERSION=$(python -m setuptools_scm)
9-
version: {{ environ['PKG_VERSION'] }}
11+
#version: {{ environ['PKG_VERSION'] }}
12+
version: {{ PKG_VERSION }}
13+
1014

1115
source:
1216
path: ..

0 commit comments

Comments
 (0)