-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove python dependency for a build script (#173)
* fix: remove python dependency for a build script * fix: remove python dependency for revision build script
- Loading branch information
Showing
5 changed files
with
35 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# Get the version description from git | ||
version=$(git describe --tags --always --dirty --long) | ||
|
||
# Use regex to match version pattern v(x.x) | ||
if [[ $version =~ v([0-9]+\.[0-9]+).* ]] | ||
then | ||
# If match found, print the version | ||
echo ${BASH_REMATCH[1]} | ||
else | ||
# Print 0.0 if no match is found | ||
echo "0.0" | ||
fi |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ $# -eq 1 ] | ||
then | ||
exec > $1 # directing stdout to the file passed as argument | ||
vermagic=$(git describe --tags --always --dirty --long) | ||
if [[ -n "$GITHUB_CI_PR_SHA" ]]; then | ||
# if GITHUB_CI_PR_SHA is set, then it's GitHub Actions build, so workaround to set a valid tag is required | ||
sha_id=${GITHUB_CI_PR_SHA:0:7} | ||
vermagic=$(echo ${vermagic} | sed "s/-g.*$/-g${sha_id}/") | ||
fi | ||
echo "#define HYDRAFW_GIT_TAG \"$vermagic\"" | ||
echo "#define HYDRAFW_CHECKIN_DATE \"$(git show -s --pretty=format:%ai | cut -d' ' -f1)\"" | ||
else | ||
echo "usage: $0 outfile.txt" | ||
exit 1 | ||
fi |
This file was deleted.
Oops, something went wrong.