-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from prompt-security/fix_auto_release_naming
Improve release/tagging/naming workflow
- Loading branch information
Showing
4 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# This script determines the current package version based on Git tags and commits. | ||
|
||
set -e # Exit immediately in case of error, do not ignore errors | ||
|
||
# Determine the package version from Git | ||
current_commit=$(git rev-parse HEAD) | ||
latest_tag_commit=$(git rev-list -n 1 --tags --abbrev=0) | ||
|
||
if [ "$current_commit" == "$latest_tag_commit" ]; then | ||
PKG_VERSION=$(git describe --tags --abbrev=0) | ||
else | ||
commit_hash=$(git rev-parse --short HEAD) | ||
date=$(date +%Y%m%d) | ||
PKG_VERSION="0.0.1.dev${date}+${commit_hash}" | ||
fi | ||
|
||
echo $PKG_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters