forked from dotnetcore/WTM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.sh
executable file
·58 lines (52 loc) · 1.35 KB
/
publish.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# 切换到当前目录
basepath=$(cd `dirname $0`; pwd)
cd $basepath
arrProjs=("WalkingTec.Mvvm.ApiDemo" "WalkingTec.Mvvm.Demo")
arrProjs1=("WalkingTec.Mvvm.Doc")
configuration="Release"
# win-x64 linux-x64
# https://docs.microsoft.com/zh-cn/dotnet/core/rid-catalog#linux-rids
runtime="win-x64"
framework="netcoreapp2.2"
outputRoot="./publish"
selfContained="true"
# 清理 publish 目录
echo "开始清理 publish 目录"
rm -rfv $outputRoot
echo "publish 目录清理完成"
# 开始发布
echo "开始发布"
for proj in ${arrProjs[@]}
do
projPath="./demo/$proj/$proj"
outputDir="$outputRoot/$proj"
echo "发布 $proj"
dotnet publish "$projPath.csproj" -c $configuration -r $runtime -f $framework --self-contained $selfContained -o "$outputDir"
echo "$proj 发布完成"
done
for proj in ${arrProjs1[@]}
do
projPath="./doc/$proj/$proj"
outputDir="$outputRoot/$proj"
echo "发布 $proj"
dotnet publish "$projPath.csproj" -c $configuration -r $runtime -f $framework --self-contained $selfContained -o "$outputDir"
echo "$proj 发布完成"
done
echo "全部发布完成"
# 打包
echo "开始打包"
cd $outputRoot
for proj in ${arrProjs[@]}
do
zipName="$proj.zip"
zip -q -r $zipName $proj
echo "$zipName 打包完成"
done
for proj in ${arrProjs1[@]}
do
zipName="$proj.zip"
zip -q -r $zipName $proj
echo "$zipName 打包完成"
done
echo "全部打包完成"