mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Use publish script and update README
This commit is contained in:
53
.github/workflows/build_and_publish.yml
vendored
53
.github/workflows/build_and_publish.yml
vendored
@@ -1,53 +0,0 @@
|
|||||||
name: Build and Publish
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "main" ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
project: [SabreTools] #[RombaSharp, SabreTools]
|
|
||||||
runtime: [win-x86, win-x64, win-arm64, linux-x64, linux-arm64, osx-x64]
|
|
||||||
framework: [net9.0] #[net20, net35, net40, net452, net472, net48, netcoreapp3.1, net5.0, net6.0, net7.0, net8.0, net9.0]
|
|
||||||
conf: [Debug] #[Release, Debug]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup .NET
|
|
||||||
uses: actions/setup-dotnet@v4
|
|
||||||
with:
|
|
||||||
dotnet-version: 9.0.x
|
|
||||||
|
|
||||||
- name: Restore dependencies
|
|
||||||
run: dotnet restore
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: dotnet publish ${{ matrix.project }}/${{ matrix.project }}.csproj -f ${{ matrix.framework }} -r ${{ matrix.runtime }} -c ${{ matrix.conf == 'Release' && 'Release -p:DebugType=None -p:DebugSymbols=false' || 'Debug'}} --self-contained true --version-suffix ${{ github.sha }} ${{ (startsWith(matrix.framework, 'net5') || startsWith(matrix.framework, 'net6') || startsWith(matrix.framework, 'net7') || startsWith(matrix.framework, 'net8') || startsWith(matrix.framework, 'net9')) && '-p:PublishSingleFile=true' || ''}}
|
|
||||||
|
|
||||||
- name: Archive build
|
|
||||||
run: |
|
|
||||||
cd ${{ matrix.project }}/bin/${{ matrix.conf }}/${{ matrix.framework }}/${{ matrix.runtime }}/publish/
|
|
||||||
zip -r ${{ github.workspace }}/${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }}.zip ./
|
|
||||||
|
|
||||||
- name: Upload build
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }}
|
|
||||||
path: ${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }}.zip
|
|
||||||
|
|
||||||
- name: Upload to rolling
|
|
||||||
uses: ncipollo/release-action@v1.14.0
|
|
||||||
with:
|
|
||||||
allowUpdates: True
|
|
||||||
artifacts: ${{ matrix.project }}_${{ matrix.framework }}_${{ matrix.runtime }}_${{ matrix.conf }}.zip
|
|
||||||
body: 'Last built commit: ${{ github.sha }}'
|
|
||||||
name: 'Rolling Release'
|
|
||||||
prerelease: True
|
|
||||||
replacesArtifacts: True
|
|
||||||
tag: "rolling"
|
|
||||||
updateOnlyUnreleased: True
|
|
||||||
43
.github/workflows/build_and_test.yml
vendored
Normal file
43
.github/workflows/build_and_test.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
name: Build and Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: 9.0.x
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: dotnet test
|
||||||
|
|
||||||
|
- name: Run publish script
|
||||||
|
run: ./publish-nix.sh -d
|
||||||
|
|
||||||
|
- name: Upload package
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: 'Nuget Package'
|
||||||
|
path: '*.nupkg'
|
||||||
|
|
||||||
|
- name: Upload to rolling
|
||||||
|
uses: ncipollo/release-action@v1.14.0
|
||||||
|
with:
|
||||||
|
allowUpdates: True
|
||||||
|
artifacts: "*.nupkg,*.zip"
|
||||||
|
body: 'Last built commit: ${{ github.sha }}'
|
||||||
|
name: 'Rolling Release'
|
||||||
|
prerelease: True
|
||||||
|
replacesArtifacts: True
|
||||||
|
tag: "rolling"
|
||||||
|
updateOnlyUnreleased: True
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
# 
|
# 
|
||||||
|
|
||||||
[](https://ci.appveyor.com/project/mnadareski/sabretools/branch/main)
|
[](https://github.com/SabreTools/SabreTools/actions/workflows/build_and_test.yml)
|
||||||
[](https://github.com/SabreTools/SabreTools/actions/workflows/build_and_publish.yml)
|
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
@@ -79,9 +78,9 @@ As of 2024-10-29, this tool is considered deprecated and will be removed at some
|
|||||||
|
|
||||||
## Builds
|
## Builds
|
||||||
|
|
||||||
Last stable releases can be found on [the Releases tab](https://github.com/SabreTools/SabreTools/releases).
|
For the most recent stable build, download the latest release here: [Releases Page](https://github.com/SabreTools/SabreTools/releases)
|
||||||
|
|
||||||
Latest unstable builds can be found on [the Rolling build](https://github.com/SabreTools/SabreTools/releases/tag/rolling).
|
For the latest WIP build here: [Rolling Release](https://github.com/SabreTools/SabreTools/releases/rolling)
|
||||||
|
|
||||||
## Contributions
|
## Contributions
|
||||||
|
|
||||||
|
|||||||
31
publish-nix.sh
Normal file → Executable file
31
publish-nix.sh
Normal file → Executable file
@@ -10,13 +10,17 @@
|
|||||||
|
|
||||||
# Optional parameters
|
# Optional parameters
|
||||||
USE_ALL=false
|
USE_ALL=false
|
||||||
|
INCLUDE_DEBUG=false
|
||||||
NO_BUILD=false
|
NO_BUILD=false
|
||||||
NO_ARCHIVE=false
|
NO_ARCHIVE=false
|
||||||
while getopts "uba" OPTION; do
|
while getopts "udba" OPTION; do
|
||||||
case $OPTION in
|
case $OPTION in
|
||||||
u)
|
u)
|
||||||
USE_ALL=true
|
USE_ALL=true
|
||||||
;;
|
;;
|
||||||
|
d)
|
||||||
|
INCLUDE_DEBUG=true
|
||||||
|
;;
|
||||||
b)
|
b)
|
||||||
NO_BUILD=true
|
NO_BUILD=true
|
||||||
;;
|
;;
|
||||||
@@ -39,6 +43,7 @@ COMMIT=$(git log --pretty=%H -1)
|
|||||||
# Output the selected options
|
# Output the selected options
|
||||||
echo "Selected Options:"
|
echo "Selected Options:"
|
||||||
echo " Use all frameworks (-u) $USE_ALL"
|
echo " Use all frameworks (-u) $USE_ALL"
|
||||||
|
echo " Include debug builds (-d) $INCLUDE_DEBUG"
|
||||||
echo " No build (-b) $NO_BUILD"
|
echo " No build (-b) $NO_BUILD"
|
||||||
echo " No archive (-a) $NO_ARCHIVE"
|
echo " No archive (-a) $NO_ARCHIVE"
|
||||||
echo " "
|
echo " "
|
||||||
@@ -88,14 +93,14 @@ if [ $NO_BUILD = false ]; then
|
|||||||
|
|
||||||
# Only .NET 5 and above can publish to a single file
|
# Only .NET 5 and above can publish to a single file
|
||||||
if [[ $(echo ${SINGLE_FILE_CAPABLE[@]} | fgrep -w $FRAMEWORK) ]]; then
|
if [[ $(echo ${SINGLE_FILE_CAPABLE[@]} | fgrep -w $FRAMEWORK) ]]; then
|
||||||
# Only include Debug if building all
|
# Only include Debug if set
|
||||||
if [ $USE_ALL = true ]; then
|
if [ $INCLUDE_DEBUG = true ]; then
|
||||||
dotnet publish RombaSharp/RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
|
dotnet publish RombaSharp/RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
|
||||||
fi
|
fi
|
||||||
dotnet publish RombaSharp/RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
|
dotnet publish RombaSharp/RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
|
||||||
else
|
else
|
||||||
# Only include Debug if building all
|
# Only include Debug if set
|
||||||
if [ $USE_ALL = true ]; then
|
if [ $INCLUDE_DEBUG = true ]; then
|
||||||
dotnet publish RombaSharp/RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
|
dotnet publish RombaSharp/RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
|
||||||
fi
|
fi
|
||||||
dotnet publish RombaSharp/RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
|
dotnet publish RombaSharp/RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
|
||||||
@@ -127,14 +132,14 @@ if [ $NO_BUILD = false ]; then
|
|||||||
|
|
||||||
# Only .NET 5 and above can publish to a single file
|
# Only .NET 5 and above can publish to a single file
|
||||||
if [[ $(echo ${SINGLE_FILE_CAPABLE[@]} | fgrep -w $FRAMEWORK) ]]; then
|
if [[ $(echo ${SINGLE_FILE_CAPABLE[@]} | fgrep -w $FRAMEWORK) ]]; then
|
||||||
# Only include Debug if building all
|
# Only include Debug if set
|
||||||
if [ $USE_ALL = true ]; then
|
if [ $INCLUDE_DEBUG = true ]; then
|
||||||
dotnet publish SabreTools/SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
|
dotnet publish SabreTools/SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
|
||||||
fi
|
fi
|
||||||
dotnet publish SabreTools/SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
|
dotnet publish SabreTools/SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
|
||||||
else
|
else
|
||||||
# Only include Debug if building all
|
# Only include Debug if set
|
||||||
if [ $USE_ALL = true ]; then
|
if [ $INCLUDE_DEBUG = true ]; then
|
||||||
dotnet publish SabreTools/SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
|
dotnet publish SabreTools/SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
|
||||||
fi
|
fi
|
||||||
dotnet publish SabreTools/SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
|
dotnet publish SabreTools/SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
|
||||||
@@ -167,8 +172,8 @@ if [ $NO_ARCHIVE = false ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Only include Debug if building all
|
# Only include Debug if set
|
||||||
if [ $USE_ALL = true ]; then
|
if [ $INCLUDE_DEBUG = true ]; then
|
||||||
cd $BUILD_FOLDER/RombaSharp/bin/Debug/${FRAMEWORK}/${RUNTIME}/publish/
|
cd $BUILD_FOLDER/RombaSharp/bin/Debug/${FRAMEWORK}/${RUNTIME}/publish/
|
||||||
zip -r $BUILD_FOLDER/RombaSharp_${FRAMEWORK}_${RUNTIME}_debug.zip .
|
zip -r $BUILD_FOLDER/RombaSharp_${FRAMEWORK}_${RUNTIME}_debug.zip .
|
||||||
fi
|
fi
|
||||||
@@ -199,8 +204,8 @@ if [ $NO_ARCHIVE = false ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Only include Debug if building all
|
# Only include Debug if set
|
||||||
if [ $USE_ALL = true ]; then
|
if [ $INCLUDE_DEBUG = true ]; then
|
||||||
cd $BUILD_FOLDER/SabreTools/bin/Debug/${FRAMEWORK}/${RUNTIME}/publish/
|
cd $BUILD_FOLDER/SabreTools/bin/Debug/${FRAMEWORK}/${RUNTIME}/publish/
|
||||||
zip -r $BUILD_FOLDER/SabreTools_${FRAMEWORK}_${RUNTIME}_debug.zip .
|
zip -r $BUILD_FOLDER/SabreTools_${FRAMEWORK}_${RUNTIME}_debug.zip .
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ param(
|
|||||||
[Alias("UseAll")]
|
[Alias("UseAll")]
|
||||||
[switch]$USE_ALL,
|
[switch]$USE_ALL,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[Alias("IncludeDebug")]
|
||||||
|
[switch]$INCLUDE_DEBUG,
|
||||||
|
|
||||||
[Parameter(Mandatory = $false)]
|
[Parameter(Mandatory = $false)]
|
||||||
[Alias("NoBuild")]
|
[Alias("NoBuild")]
|
||||||
[switch]$NO_BUILD,
|
[switch]$NO_BUILD,
|
||||||
@@ -30,6 +34,7 @@ $COMMIT = git log --pretty=format:"%H" -1
|
|||||||
# Output the selected options
|
# Output the selected options
|
||||||
Write-Host "Selected Options:"
|
Write-Host "Selected Options:"
|
||||||
Write-Host " Use all frameworks (-UseAll) $USE_ALL"
|
Write-Host " Use all frameworks (-UseAll) $USE_ALL"
|
||||||
|
Write-Host " Include debug builds (-IncludeDebug) $INCLUDE_DEBUG"
|
||||||
Write-Host " No build (-NoBuild) $NO_BUILD"
|
Write-Host " No build (-NoBuild) $NO_BUILD"
|
||||||
Write-Host " No archive (-NoArchive) $NO_ARCHIVE"
|
Write-Host " No archive (-NoArchive) $NO_ARCHIVE"
|
||||||
Write-Host " "
|
Write-Host " "
|
||||||
@@ -75,15 +80,15 @@ if (!$NO_BUILD.IsPresent) {
|
|||||||
|
|
||||||
# Only .NET 5 and above can publish to a single file
|
# Only .NET 5 and above can publish to a single file
|
||||||
if ($SINGLE_FILE_CAPABLE -contains $FRAMEWORK) {
|
if ($SINGLE_FILE_CAPABLE -contains $FRAMEWORK) {
|
||||||
# Only include Debug if building all
|
# Only include Debug if set
|
||||||
if ($USE_ALL.IsPresent) {
|
if ($INCLUDE_DEBUG.IsPresent) {
|
||||||
dotnet publish RombaSharp\RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
|
dotnet publish RombaSharp\RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
|
||||||
}
|
}
|
||||||
dotnet publish RombaSharp\RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
|
dotnet publish RombaSharp\RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Only include Debug if building all
|
# Only include Debug if set
|
||||||
if ($USE_ALL.IsPresent) {
|
if ($INCLUDE_DEBUG.IsPresent) {
|
||||||
dotnet publish RombaSharp\RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
|
dotnet publish RombaSharp\RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
|
||||||
}
|
}
|
||||||
dotnet publish RombaSharp\RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
|
dotnet publish RombaSharp\RombaSharp.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
|
||||||
@@ -111,15 +116,15 @@ if (!$NO_BUILD.IsPresent) {
|
|||||||
|
|
||||||
# Only .NET 5 and above can publish to a single file
|
# Only .NET 5 and above can publish to a single file
|
||||||
if ($SINGLE_FILE_CAPABLE -contains $FRAMEWORK) {
|
if ($SINGLE_FILE_CAPABLE -contains $FRAMEWORK) {
|
||||||
# Only include Debug if building all
|
# Only include Debug if set
|
||||||
if ($USE_ALL.IsPresent) {
|
if ($INCLUDE_DEBUG.IsPresent) {
|
||||||
dotnet publish SabreTools\SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
|
dotnet publish SabreTools\SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
|
||||||
}
|
}
|
||||||
dotnet publish SabreTools\SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
|
dotnet publish SabreTools\SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Only include Debug if building all
|
# Only include Debug if set
|
||||||
if ($USE_ALL.IsPresent) {
|
if ($INCLUDE_DEBUG.IsPresent) {
|
||||||
dotnet publish SabreTools\SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
|
dotnet publish SabreTools\SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
|
||||||
}
|
}
|
||||||
dotnet publish SabreTools\SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
|
dotnet publish SabreTools\SabreTools.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
|
||||||
@@ -148,8 +153,8 @@ if (!$NO_ARCHIVE.IsPresent) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
# Only include Debug if building all
|
# Only include Debug if set
|
||||||
if ($USE_ALL.IsPresent) {
|
if ($INCLUDE_DEBUG.IsPresent) {
|
||||||
Set-Location -Path $BUILD_FOLDER\RombaSharp\bin\Debug\${FRAMEWORK}\${RUNTIME}\publish\
|
Set-Location -Path $BUILD_FOLDER\RombaSharp\bin\Debug\${FRAMEWORK}\${RUNTIME}\publish\
|
||||||
7z a -tzip $BUILD_FOLDER\RombaSharp_${FRAMEWORK}_${RUNTIME}_debug.zip *
|
7z a -tzip $BUILD_FOLDER\RombaSharp_${FRAMEWORK}_${RUNTIME}_debug.zip *
|
||||||
}
|
}
|
||||||
@@ -177,8 +182,8 @@ if (!$NO_ARCHIVE.IsPresent) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
# Only include Debug if building all
|
# Only include Debug if set
|
||||||
if ($USE_ALL.IsPresent) {
|
if ($INCLUDE_DEBUG.IsPresent) {
|
||||||
Set-Location -Path $BUILD_FOLDER\SabreTools\bin\Debug\${FRAMEWORK}\${RUNTIME}\publish\
|
Set-Location -Path $BUILD_FOLDER\SabreTools\bin\Debug\${FRAMEWORK}\${RUNTIME}\publish\
|
||||||
7z a -tzip $BUILD_FOLDER\SabreTools_${FRAMEWORK}_${RUNTIME}_debug.zip *
|
7z a -tzip $BUILD_FOLDER\SabreTools_${FRAMEWORK}_${RUNTIME}_debug.zip *
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user