create_release.sh 922 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. release_name="0.3"
  3. release_description="Dockerization"
  4. release_notes="CALDER2 release: ${release_description} (${release_name})"
  5. latest_tag=$(git describe --tags --abbrev=0)
  6. if [[ "${release_name}" == "${latest_tag}" ]]
  7. then
  8. echo "Overwriting exiting release (${release_name})"
  9. echo "---------------------------------------------"
  10. # Detelting Github release (should prompt a confirmation)
  11. gh release delete ${release_name}
  12. # Deleting local tag
  13. git tag -d ${release_name}
  14. # Pushing the removal of the tag to Github
  15. git push origin :${release_name}
  16. fi
  17. echo "Uploading new release (${release_name})"
  18. echo "---------------------------------------------"
  19. # Creating new tag
  20. git tag -a ${release_name} -m ${release_description}
  21. # Pushing new tag
  22. git push origin ${release_name}
  23. # Creating release from tag
  24. gh release create ${release_name} --title "${release_description}" --notes "${release_notes}"