Skip to content

Commit f8c713b

Browse files
committed
Use publish script and update README
1 parent 4d0122f commit f8c713b

File tree

5 files changed

+29
-80
lines changed

5 files changed

+29
-80
lines changed
Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Nuget Pack
1+
name: Build and Test
22

33
on:
44
push:
@@ -18,29 +18,23 @@ jobs:
1818
with:
1919
dotnet-version: 9.0.x
2020

21-
- name: Restore dependencies
22-
run: dotnet restore
23-
24-
- name: Build library
25-
run: dotnet build
26-
2721
- name: Run tests
2822
run: dotnet test
2923

30-
- name: Pack
31-
run: dotnet pack
24+
- name: Run publish script
25+
run: ./publish-nix.sh -d
3226

33-
- name: Upload build
27+
- name: Upload package
3428
uses: actions/upload-artifact@v4
3529
with:
3630
name: 'Nuget Package'
37-
path: 'SabreTools.Serialization/bin/Release/*.nupkg'
31+
path: '*.nupkg'
3832

3933
- name: Upload to rolling
4034
uses: ncipollo/[email protected]
4135
with:
4236
allowUpdates: True
43-
artifacts: 'SabreTools.Serialization/bin/Release/*.nupkg'
37+
artifacts: "*.nupkg,*.zip"
4438
body: 'Last built commit: ${{ github.sha }}'
4539
name: 'Rolling Release'
4640
prerelease: True

.github/workflows/build_test.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

README.MD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# SabreTools.Serialization
22

3+
[![Build and Test](https://github.com/SabreTools/SabreTools.Serialization/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/SabreTools/SabreTools.Serialization/actions/workflows/build_and_test.yml)
4+
35
This library comprises of serializers that both read and write from files and streams to the dedicated models as well as convert to and from the common internal models. This library is partially used by the current parsing and writing code but none of the internal model serialization is used.
46

57
Find the link to the Nuget package [here](https://www.nuget.org/packages/SabreTools.Serialization).

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 InfoPrint/InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
97101
fi
98102
dotnet publish InfoPrint/InfoPrint.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 InfoPrint/InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
103107
fi
104108
dotnet publish InfoPrint/InfoPrint.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/InfoPrint/bin/Debug/${FRAMEWORK}/${RUNTIME}/publish/
137141
zip -r $BUILD_FOLDER/InfoPrint_${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 InfoPrint\InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
8488
}
8589
dotnet publish InfoPrint\InfoPrint.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 InfoPrint\InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
9195
}
9296
dotnet publish InfoPrint\InfoPrint.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\InfoPrint\bin\Debug\${FRAMEWORK}\${RUNTIME}\publish\
121125
7z a -tzip $BUILD_FOLDER\InfoPrint_${FRAMEWORK}_${RUNTIME}_debug.zip *
122126
}

0 commit comments

Comments
 (0)