-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.sh
More file actions
28 lines (25 loc) · 1.05 KB
/
publish.sh
File metadata and controls
28 lines (25 loc) · 1.05 KB
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
26
27
28
# *******************************
# 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
# ****************************************
# Publishing as self-contained
# Packages dotnet with the application
#
# container flags: --os linux --arch x64 /t:PublishContainer
# rids: linux-x64, linux-arm64, osx-x64, osx-arm64, win-x64, win-arm64
# https://learn.microsoft.com/en-us/dotnet/core/rid-catalog
dotnet publish $solution --framework net8.0 --configuration Release --self-contained true -r linux-x64 -p:Version=$version