Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
EasyCloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DSDF
EasyCloud
Commits
558cc792
Commit
558cc792
authored
5 years ago
by
sguazt
Browse files
Options
Downloads
Patches
Plain Diff
Bumped version number to 1.0.0
parent
46862461
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
VERSION
+1
-0
1 addition, 0 deletions
VERSION
make_release.sh
+84
-0
84 additions, 0 deletions
make_release.sh
with
85 additions
and
0 deletions
VERSION
0 → 100644
+
1
−
0
View file @
558cc792
1.0.0
This diff is collapsed.
Click to expand it.
make_release.sh
0 → 100755
+
84
−
0
View file @
558cc792
#!/bin/bash
#
# Simple script to create a new release in a Git repository.
#
# Increase the version number and update the Git repo with the new version
# number and a new annotated tag marking the new release.
#
# By default, this script reads version number from the `VERSION` file and
# increments the patch level (i.e., if `VERSION` contains `maj.min.pat`, this
# scripts will create a release for version `maj.min.(pat+1)`).
#
# Usage:
# <script name> <release-type> [<version-file>]
# where:
# - <release-type>: the type of the release; one of 'major', 'minor' and
# 'patch'.
# [default: 'patch']
# - <version-file>: the file containing the version number.
# [default: 'VERSION']
#
#
# Marco Guazzone (marco.guazzone@gmail.com)
#
default_release_type
=
patch
default_version_file
=
VERSION
release_type
=
$default_release_type
version_file
=
$default_version_file
if
[
$#
-gt
0
]
;
then
release_type
=
$1
if
[
$#
-gt
1
]
;
then
version_file
=
$2
fi
fi
if
[
!
-e
"
$version_file
"
]
;
then
echo
"Version file '
$version_file
' not found. Created a new one for version '0.0.0'"
echo
"0.0.0"
>
$version_file
fi
version
=
$(
cat
$version_file
)
IFS
=
'.'
read
-r
major_version minor_version patch_version
<<<
"
$version
"
case
"
$release_type
"
in
major
)
major_version
=
$((
major_version+1
))
minor_version
=
0
patch_version
=
0
;;
minor
)
minor_version
=
$((
minor_version+1
))
patch_version
=
0
;;
patch
)
patch_version
=
$((
patch_version+1
))
;;
*
)
echo
"Usage:
$0
<release-type> [<version-file>]"
echo
"where:"
echo
"- <release-type> is one of 'major', 'minor', 'patch'. [default: '
$default_release_type
']"
echo
"- <version-file> is the path to the file containing the version number. [default: '
$default_version_file
']"
exit
1
;;
esac
new_version
=
"
${
major_version
}
.
${
minor_version
}
.
${
patch_version
}
"
cp
-f
$version_file
$version_file
.bak
\
&&
echo
"
$new_version
"
>
$version_file
\
&&
git add
$version_file
\
&&
git ci
-m
"Bumped version number to
$new_version
"
\
&&
git tag
-a
"v
${
new_version
}
"
-m
"Released version
$new_version
."
\
&&
git push
--follow-tags
\
&&
rm
-f
"
$version_file
.bak"
if
[
$?
-ne
0
]
;
then
echo
"Something went wrong! Please check your repo."
exit
1
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment