Skip to content

Commit fca08da

Browse files
EliEli
authored andcommitted
Still run CI but publishing to conda is conditional on a tag.
1 parent 30e5808 commit fca08da

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Python Package using Conda
22

3-
on:
4-
push:
5-
tags:
6-
- "v*"
3+
on: [push]
74

85
jobs:
96
build-linux:
@@ -51,9 +48,18 @@ jobs:
5148
echo "=== variant.yaml ==="
5249
cat conda.recipe/variant.yaml
5350
54-
conda config --set anaconda_upload yes
51+
# Publish only on tags (still build/test on branch pushes)
52+
if [ "${GITHUB_REF_TYPE:-}" = "tag" ]; then
53+
echo "Tag push (${GITHUB_REF_NAME}); enabling upload."
54+
conda config --set anaconda_upload yes
55+
conda build -m conda.recipe/variant.yaml -c cadwr-dms -c conda-forge \
56+
--user cadwr-dms --token "$ANACONDA_CHANNEL_UPLOAD_TOKEN" conda.recipe
57+
else
58+
echo "Branch push (${GITHUB_REF_NAME}); building without upload."
59+
conda config --set anaconda_upload no
60+
conda build -m conda.recipe/variant.yaml -c cadwr-dms -c conda-forge conda.recipe
61+
fi
5562
56-
conda build -m conda.recipe/variant.yaml -c cadwr-dms -c conda-forge --user cadwr-dms --token "$ANACONDA_CHANNEL_UPLOAD_TOKEN" conda.recipe
5763
5864
conda deactivate
5965
conda remove -n test_dms_datastore --all -y

0 commit comments

Comments
 (0)