Automated nuget package build
So you don't have to do it manually every time
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -422,7 +422,10 @@ FodyWeavers.xsd
|
|||||||
|
|
||||||
# Moonlight
|
# Moonlight
|
||||||
storage/
|
storage/
|
||||||
Moonlight/Moonlight.Client/wwwroot/css/style.min.css
|
|
||||||
/.idea/.idea.Moonlight/.idea
|
/.idea/.idea.Moonlight/.idea
|
||||||
style.min.css
|
style.min.css
|
||||||
core.min.css
|
core.min.css
|
||||||
|
|
||||||
|
# Build script for nuget packages
|
||||||
|
finalPackages/
|
||||||
|
nupkgs/
|
||||||
14
Resources/Readme/logo.svg
Normal file
14
Resources/Readme/logo.svg
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="256px" height="301px" viewBox="0 0 256 301" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
|
||||||
|
<defs>
|
||||||
|
<linearGradient x1="2.17771739%" y1="34.7938955%" x2="92.7221942%" y2="91.3419405%" id="linearGradient-1">
|
||||||
|
<stop stop-color="#41A7EF" offset="0%"></stop>
|
||||||
|
<stop stop-color="#813DDE" offset="54.2186236%"></stop>
|
||||||
|
<stop stop-color="#8F2EE2" offset="74.4988788%"></stop>
|
||||||
|
<stop stop-color="#A11CE6" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<g>
|
||||||
|
<path d="M124.183681,101.699 C124.183681,66.515 136.256681,34.152 156.486681,8.525 C159.197681,5.092 156.787681,0.069 152.412681,0.012 C151.775681,0.004 151.136681,0 150.497681,0 C67.6206813,0 0.390681343,66.99 0.00168134279,149.775 C-0.386318657,232.369 66.4286813,300.195 149.019681,300.988 C189.884681,301.381 227.036681,285.484 254.376681,259.395 C257.519681,256.396 255.841681,251.082 251.548681,250.42 C179.413681,239.291 124.183681,176.949 124.183681,101.699" fill="url(#linearGradient-1)"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
58
Resources/Scripts/buildNuget.sh
Normal file
58
Resources/Scripts/buildNuget.sh
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Note: Run in main directory, i.e. where the Moonlight.sln is
|
||||||
|
|
||||||
|
echo "Building nuget packages"
|
||||||
|
|
||||||
|
echo "Searching & building project files"
|
||||||
|
project_files=$(find . -name "*.csproj")
|
||||||
|
|
||||||
|
for project in $project_files; do
|
||||||
|
# Extract project name
|
||||||
|
project_name=$(basename "$project" .csproj)
|
||||||
|
|
||||||
|
# Extract version
|
||||||
|
project_version=$(grep -oPm1 "(?<=<Version>)[^<]+" "$project")
|
||||||
|
if [ -z "$project_version" ]; then
|
||||||
|
echo "No <Version> tag found in $project, skipping."
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Building nuget package
|
||||||
|
pwd=$(pwd)
|
||||||
|
project_path=$(dirname $project)
|
||||||
|
(cd $project_path; dotnet build --configuration Release; dotnet pack --configuration Release --output $pwd/nupkgs)
|
||||||
|
|
||||||
|
# Mod nuget package
|
||||||
|
echo "Modding nuget package"
|
||||||
|
nugetPackage=$(find $pwd/nupkgs -name "*.nupkg")
|
||||||
|
|
||||||
|
unzip -o $nugetPackage -d $pwd/nupkgs/mod
|
||||||
|
|
||||||
|
if [ "$project_name" = "Moonlight.ApiServer" ]; then
|
||||||
|
rm -r $pwd/nupkgs/mod/content
|
||||||
|
rm -r $pwd/nupkgs/mod/contentFiles
|
||||||
|
|
||||||
|
sed -i "/<contentFiles>/,/<\/contentFiles>/d" $pwd/nupkgs/mod/Moonlight.ApiServer.nuspec
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$project_name" = "Moonlight.Client" ]; then
|
||||||
|
rm -r $pwd/nupkgs/mod/staticwebassets/_framework
|
||||||
|
|
||||||
|
sed -i '/<StaticWebAsset Include=.*blazor.webassembly.js.gz.*>/,/<\/StaticWebAsset>/d' $pwd/nupkgs/mod/build/Microsoft.AspNetCore.StaticWebAssets.props
|
||||||
|
sed -i '/<StaticWebAsset Include=.*blazor.webassembly.js.*>/,/<\/StaticWebAsset>/d' $pwd/nupkgs/mod/build/Microsoft.AspNetCore.StaticWebAssets.props
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Repacking nuget package"
|
||||||
|
rm $nugetPackage
|
||||||
|
(cd nupkgs/mod/; zip -r -o $nugetPackage *)
|
||||||
|
|
||||||
|
mkdir -p $pwd/finalPackages/
|
||||||
|
|
||||||
|
mv $nugetPackage $pwd/finalPackages/
|
||||||
|
|
||||||
|
echo "Cleaning up"
|
||||||
|
rm -r $pwd/nupkgs/mod
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user