Skip to content

Commit 584ec00

Browse files
committed
Include debug builds in publish script
1 parent 7c428ae commit 584ec00

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: dotnet test
2323

2424
- name: Run publish script
25-
run: ./publish-nix.sh
25+
run: ./publish-nix.sh -d
2626

2727
- name: Upload package
2828
uses: actions/upload-artifact@v4

publish-nix.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@
1010

1111
# Optional parameters
1212
USE_ALL=false
13+
INCLUDE_DEBUG=false
1314
NO_BUILD=false
1415
NO_ARCHIVE=false
15-
while getopts "uba" OPTION; do
16+
while getopts "udba" OPTION; do
1617
case $OPTION in
1718
u)
1819
USE_ALL=true
1920
;;
21+
d)
22+
INCLUDE_DEBUG=true
23+
;;
2024
b)
2125
NO_BUILD=true
2226
;;
@@ -91,14 +95,14 @@ if [ $NO_BUILD = false ]; then
9195

9296
# Only .NET 5 and above can publish to a single file
9397
if [[ $(echo ${SINGLE_FILE_CAPABLE[@]} | fgrep -w $FRAMEWORK) ]]; then
94-
# Only include Debug if building all
95-
if [ $USE_ALL = true ]; then
98+
# Only include Debug if set
99+
if [ $INCLUDE_DEBUG = true ]; then
96100
dotnet publish Headerer/Headerer.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
97101
fi
98102
dotnet publish Headerer/Headerer.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
99103
else
100-
# Only include Debug if building all
101-
if [ $USE_ALL = true ]; then
104+
# Only include Debug if set
105+
if [ $INCLUDE_DEBUG = true ]; then
102106
dotnet publish Headerer/Headerer.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
103107
fi
104108
dotnet publish Headerer/Headerer.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
@@ -131,8 +135,8 @@ if [ $NO_ARCHIVE = false ]; then
131135
fi
132136
fi
133137

134-
# Only include Debug if building all
135-
if [ $USE_ALL = true ]; then
138+
# Only include Debug if set
139+
if [ $INCLUDE_DEBUG = true ]; then
136140
cd $BUILD_FOLDER/Headerer/bin/Debug/${FRAMEWORK}/${RUNTIME}/publish/
137141
zip -r $BUILD_FOLDER/Headerer_${FRAMEWORK}_${RUNTIME}_debug.zip .
138142
fi

publish-win.ps1

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ param(
1212
[Alias("UseAll")]
1313
[switch]$USE_ALL,
1414

15+
[Parameter(Mandatory = $false)]
16+
[Alias("IncludeDebug")]
17+
[switch]$INCLUDE_DEBUG,
18+
1519
[Parameter(Mandatory = $false)]
1620
[Alias("NoBuild")]
1721
[switch]$NO_BUILD,
@@ -78,15 +82,15 @@ if (!$NO_BUILD.IsPresent) {
7882

7983
# Only .NET 5 and above can publish to a single file
8084
if ($SINGLE_FILE_CAPABLE -contains $FRAMEWORK) {
81-
# Only include Debug if building all
82-
if ($USE_ALL.IsPresent) {
85+
# Only include Debug if set
86+
if ($INCLUDE_DEBUG.IsPresent) {
8387
dotnet publish Headerer\Headerer.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
8488
}
8589
dotnet publish Headerer\Headerer.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
8690
}
8791
else {
88-
# Only include Debug if building all
89-
if ($USE_ALL.IsPresent) {
92+
# Only include Debug if set
93+
if ($INCLUDE_DEBUG.IsPresent) {
9094
dotnet publish Headerer\Headerer.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
9195
}
9296
dotnet publish Headerer\Headerer.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
@@ -115,8 +119,8 @@ if (!$NO_ARCHIVE.IsPresent) {
115119
continue
116120
}
117121

118-
# Only include Debug if building all
119-
if ($USE_ALL.IsPresent) {
122+
# Only include Debug if set
123+
if ($INCLUDE_DEBUG.IsPresent) {
120124
Set-Location -Path $BUILD_FOLDER\Headerer\bin\Debug\${FRAMEWORK}\${RUNTIME}\publish\
121125
7z a -tzip $BUILD_FOLDER\Headerer_${FRAMEWORK}_${RUNTIME}_debug.zip *
122126
}

0 commit comments

Comments
 (0)