Skip to content

Commit 104bddb

Browse files
committed
Check coherence between Conda package version and Git tag
Thusly, we make sure that the Conda package version stays correlated with the Git tag.
1 parent a4d2e8c commit 104bddb

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/conda.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,24 @@ jobs:
238238
# See the upload-artifact step in the build job for the explanation of this pattern
239239
name: khiops-conda
240240
path: ./khiops-conda
241+
- name: Check Conda package / Git tag version coherence
242+
run: |
243+
# Don't exit on first error: print relevant error message
244+
set +e
245+
# Extract Conda package version from the package artifact
246+
PACKAGE_VERSION=$( \
247+
unzip -p ./khiops-conda/noarch/*.conda info-*.tar.zst \
248+
| tar --zstd -axf - info/index.json -O \
249+
| jq -r ".version" \
250+
)
251+
# Convert pre-release version specification in the Git tag to the
252+
# Conda format and check that it matches the Conda package version
253+
echo ${{ github.ref_name }} | tr -d '-' | grep -wq $PACKAGE_VERSION
254+
if [[ $? -ne 0 ]]
255+
then
256+
echo "::error::Conda package version $PACKAGE_VERSION does not match Git tag ${{ github.ref_name }}"
257+
false
258+
fi
241259
- name: Install Miniforge
242260
uses: conda-incubator/setup-miniconda@v3
243261
with:

0 commit comments

Comments
 (0)