-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated gitHeadLocal.gin * add create-release.sh script #7 * Updated gitHeadLocal.gin
- Loading branch information
Showing
2 changed files
with
53 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
\usepackage[% | ||
shash={e65c9e2}, | ||
lhash={e65c9e2f7454b5c49de946e2a8eceedebca803cd}, | ||
shash={3400099}, | ||
lhash={3400099fa7e9bf11823012d44c68c4277fc1cd2f}, | ||
authname={Christophe Prud'homme}, | ||
authemail={[email protected]}, | ||
authsdate={2024-08-04}, | ||
authidate={2024-08-04 17:03:16 +0200}, | ||
authudate={1722783796}, | ||
authidate={2024-08-04 23:21:20 +0200}, | ||
authudate={1722806480}, | ||
commname={Christophe Prud'homme}, | ||
commemail={[email protected]}, | ||
commsdate={2024-08-04}, | ||
commidate={2024-08-04 17:03:16 +0200}, | ||
commudate={1722783796}, | ||
refnames={ (HEAD -> main, tag: v1.1.1, tag: v1.1.0, origin/main, origin/HEAD)}, | ||
firsttagdescribe={v1.1.0}, | ||
reltag={v1.1.0-0-ge65c9e2} | ||
commidate={2024-08-04 23:21:20 +0200}, | ||
commudate={1722806480}, | ||
refnames={ (HEAD -> 7-add-create-releasesh-script)}, | ||
firsttagdescribe={v1.1.0-3-g3400099}, | ||
reltag={v1.1.0-3-g3400099} | ||
]{gitexinfo} |
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,44 @@ | ||
#!/bin/bash | ||
|
||
# Exit immediately if a command exits with a non-zero status | ||
set -e | ||
|
||
# Function to create a release | ||
create_release() { | ||
VERSION=$1 | ||
|
||
if [ -z "$VERSION" ]; then | ||
echo "Usage: $0 create vx.y.z" | ||
exit 1 | ||
fi | ||
|
||
# Tag the repository with the provided version | ||
git tag -a "$VERSION" -m "Release $VERSION" | ||
|
||
# Checkout the tag to trigger post-commit hook to update gitinfo2 info file | ||
git checkout | ||
|
||
# Push the changes and the tags | ||
git push origin main --follow-tags | ||
|
||
echo "Release $VERSION created and pushed successfully." | ||
} | ||
|
||
# Function to list releases | ||
list_releases() { | ||
git tag | ||
} | ||
|
||
# Main script logic | ||
case "$1" in | ||
create) | ||
create_release "$2" | ||
;; | ||
list) | ||
list_releases | ||
;; | ||
*) | ||
echo "Usage: $0 {create|list} [version]" | ||
exit 1 | ||
;; | ||
esac |