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>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
|
<DebugType>none</DebugType>
|
||||||
|
<DebugSymbols>false</DebugSymbols>
|
||||||
<AnalysisLevel>latest-recommended</AnalysisLevel>
|
<AnalysisLevel>latest-recommended</AnalysisLevel>
|
||||||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ try {
|
|||||||
-p:PublishAot=true `
|
-p:PublishAot=true `
|
||||||
-p:StripSymbols=true `
|
-p:StripSymbols=true `
|
||||||
-p:DebugType=none `
|
-p:DebugType=none `
|
||||||
|
-p:DebugSymbols=false `
|
||||||
--artifacts-path $buildRoot `
|
--artifacts-path $buildRoot `
|
||||||
-o $output
|
-o $output
|
||||||
if ($LASTEXITCODE -ne 0) {
|
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 \
|
(cd "$root/backend" && dotnet publish src/Monitor.Backend \
|
||||||
-m:3 -c Release --no-self-contained \
|
-m:3 -c Release --no-self-contained \
|
||||||
|
-p:DebugType=none -p:DebugSymbols=false \
|
||||||
-p:UseAppHost=false -p:OpenApiGenerateDocuments=false \
|
-p:UseAppHost=false -p:OpenApiGenerateDocuments=false \
|
||||||
--artifacts-path "$build_root" -o "$output")
|
--artifacts-path "$build_root" -o "$output")
|
||||||
|
find "$output" -type f -name '*.pdb' -delete
|
||||||
cp -a "$output/." "$container_context/app/"
|
cp -a "$output/." "$container_context/app/"
|
||||||
: > "$container_context/data/.keep"
|
: > "$container_context/data/.keep"
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -17,7 +17,7 @@ case "$project" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
out="backend/artifacts/publish/$project/$rid"
|
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
|
case "$rid" in
|
||||||
linux-musl-x64)
|
linux-musl-x64)
|
||||||
@@ -34,7 +34,7 @@ case "$rid" in
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
cd "$root/backend" # global.json 在 backend/ 下
|
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
|
esac
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user