-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
25 lines (22 loc) · 786 Bytes
/
build.sh
File metadata and controls
25 lines (22 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# *******************************
# Build script
# *******************************
solution=$1 # solution name: my-solution.sln
major=$2 # major version: 1
minor=$3 # minor version: 0
#
# revision and build are: twoDigitYear-dayOfYear.hour-minute
# - this provides uniqueness to the minute for each assembly
# - eg: build version :: 1.0.240713.0116 -> 2024 July 13, 1:16AM
#
year="$(date '+%Y')"
revision=${year:2:2}"$(date '+%j')"
build="$(date '+%H%M')"
# build the version number -
version=$major.$minor.$revision.$build
echo "build version :: " $version
#
# build and tag the version number
# - alternate - /p:Version=
dotnet clean $solution
dotnet build $solution --configuration Debug -p:Version=$version