Skip to content

Commit 67cc28a

Browse files
EliEli
authored andcommitted
Changed tactics on variant.yaml writing to printf.
1 parent 7578d73 commit 67cc28a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,17 @@ jobs:
3535
git fetch --force --tags
3636
echo "Describe: $(git describe --tags --dirty --always || true)"
3737
38-
RAW_VERSION=$(python -m setuptools_scm)
39-
echo "Raw setuptools_scm version: $RAW_VERSION"
38+
RAW_VERSION="$(python -m setuptools_scm | tr -d '\r\n')"
39+
PKG_VERSION="$(echo "$RAW_VERSION" | sed -E 's/\+g([0-9a-f]+)/.g\1/; s/-g([0-9a-f]+)/.g\1/')"
40+
4041
41-
PKG_VERSION=$(echo "$RAW_VERSION" | sed -E 's/\+g([0-9a-f]+)/.g\1/; s/-g([0-9a-f]+)/.g\1/')
42-
echo "Conda-safe version: $PKG_VERSION"
4342
4443
if [ -z "$PKG_VERSION" ] || [ "$PKG_VERSION" = "0.0.0" ] || [ "$PKG_VERSION" = "None" ]; then
4544
echo "ERROR: Bad PKG_VERSION='$PKG_VERSION'"
4645
exit 1
4746
fi
4847
49-
cat > conda.recipe/variant.yaml <<EOF
50-
PKG_VERSION: $PKG_VERSION
51-
SCM_VERSION: $RAW_VERSION
52-
EOF
48+
printf "PKG_VERSION: %s\nSCM_VERSION: %s\n" "$PKG_VERSION" "$RAW_VERSION" > conda.recipe/variant.yaml
5349
5450
echo "PKG_VERSION: $PKG_VERSION" > conda.recipe/variant.yaml
5551
cat conda.recipe/variant.yaml

0 commit comments

Comments
 (0)