build: disable PDB debug symbols in releases [CI SKIP]
This commit is contained in:
1 parent
6b12049df0
commit
a9ee4ec34c
4 files changed
+7
-2
No files matched your search
@@ -5,6 +5,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<DebugType>none</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<AnalysisLevel>latest-recommended</AnalysisLevel>
|
||||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
|
||||
@@ -61,6 +61,7 @@ try {
|
||||
-p:PublishAot=true `
|
||||
-p:StripSymbols=true `
|
||||
-p:DebugType=none `
|
||||
-p:DebugSymbols=false `
|
||||
--artifacts-path $buildRoot `
|
||||
-o $output
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
|
||||
@@ -33,8 +33,10 @@ mkdir -p "$output" "$build_root" "$container_context/app" "$container_context/da
|
||||
|
||||
(cd "$root/backend" && dotnet publish src/Monitor.Backend \
|
||||
-m:3 -c Release --no-self-contained \
|
||||
-p:DebugType=none -p:DebugSymbols=false \
|
||||
-p:UseAppHost=false -p:OpenApiGenerateDocuments=false \
|
||||
--artifacts-path "$build_root" -o "$output")
|
||||
find "$output" -type f -name '*.pdb' -delete
|
||||
cp -a "$output/." "$container_context/app/"
|
||||
: > "$container_context/data/.keep"
|
||||
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ case "$project" in
|
||||
esac
|
||||
|
||||
out="backend/artifacts/publish/$project/$rid"
|
||||
args=(publish "$csproj" -c Release -r "$rid" -p:PublishAot=true -p:DebugType=none -o "/src/$out" --artifacts-path /artifacts -nologo -v q)
|
||||
args=(publish "$csproj" -c Release -r "$rid" -p:PublishAot=true -p:DebugType=none -p:DebugSymbols=false -o "/src/$out" --artifacts-path /artifacts -nologo -v q)
|
||||
|
||||
case "$rid" in
|
||||
linux-musl-x64)
|
||||
@@ -34,7 +34,7 @@ case "$rid" in
|
||||
;;
|
||||
*)
|
||||
cd "$root/backend" # global.json 在 backend/ 下
|
||||
dotnet publish "${csproj#backend/}" -c Release -r "$rid" -p:PublishAot=true -o "$root/$out" -nologo -v q
|
||||
dotnet publish "${csproj#backend/}" -c Release -r "$rid" -p:PublishAot=true -p:DebugType=none -p:DebugSymbols=false -o "$root/$out" -nologo -v q
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in new issue
Block a user