From 331cef5dda4410e078d5887dd9dd80d27809c8c1 Mon Sep 17 00:00:00 2001
From: gdulafactset <156331405+gdulafactset@users.noreply.github.com>
Date: Thu, 20 Jun 2024 16:51:08 +0100
Subject: [PATCH] chore: use real tag_name + script comments

---
 .github/workflows/publish.yml | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index b15a916..12e6b30 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -49,25 +49,26 @@ jobs:
           count=0
           max_retries=5
           while [ $count -lt $max_retries ]; do
-            if pip install fds.sdk.utils==2.0.0 --dry-run &>/dev/null; then
-              echo "Version 2.0.0 of fds.sdk.utils is available on PyPI."
+            if pip install fds.sdk.utils==${{ github.event.release.tag_name }} --dry-run &>/dev/null; then
+              echo "Version ${{ github.event.release.tag_name }} of fds.sdk.utils is available on PyPI."
               
               conda install grayskull conda-build anaconda-client
               conda info
               conda list
               grayskull --version
               anaconda --version
-    
-              grayskull pypi fds.sdk.utils==2.0.0
-    
+
+              # Create meta.yaml recipe for the package pulled from PyPi
+              grayskull pypi fds.sdk.utils==${{ github.event.release.tag_name }}
+
+              # Modify the meta.yaml recipe-maintainers property to include all maintainers of this repo
               sed -i "/recipe-maintainers:/,/extra:/ s/- .*/- gdulafactset/" fds.sdk.utils/meta.yaml
               echo "    - mima0815" >> fds.sdk.utils/meta.yaml
               echo "    - eschmidtfds" >> fds.sdk.utils/meta.yaml
               echo "    - Filip1x9" >> fds.sdk.utils/meta.yaml
               echo "    - dgawande12" >> fds.sdk.utils/meta.yaml
 
-              cat fds.sdk.utils/meta.yaml
-              
+              # Build conda package
               conda config --set anaconda_upload no
               conda build fds.sdk.utils --output
               break