Fix nuget ci

This commit is contained in:
David 2020-08-13 15:22:12 +02:00
parent 741ab4301c
commit a61f6e3308
7 changed files with 38 additions and 3 deletions

View File

@ -153,11 +153,11 @@ jobs:
vmImage: 'ubuntu-latest'
steps:
- task: NuGetCommand@2
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
packagesToPack: Jellyfin.Data/Jellyfin.Data.csproj;MediaBrowser.Common/MediaBrowser.Common.csproj;MediaBrowser.Controller/MediaBrowser.Controller.csproj;MediaBrowser.Model/MediaBrowser.Model.csproj;Emby.Naming/Emby.Naming.csproj
packDestination: '$(Build.ArtifactStagingDirectory)'
packagesToPack: 'Jellyfin.Data/Jellyfin.Data.csproj;MediaBrowser.Common/MediaBrowser.Common.csproj;MediaBrowser.Controller/MediaBrowser.Controller.csproj;MediaBrowser.Model/MediaBrowser.Model.csproj;Emby.Naming/Emby.Naming.csproj'
versioningScheme: 'off'
- task: NuGetCommand@2
inputs:

View File

@ -23,6 +23,7 @@
<PropertyGroup>
<Authors>Jellyfin Contributors</Authors>
<PackageId>Jellyfin.Naming</PackageId>
<PackageVersion>10.7.0</PackageVersion>
<PackageLicenseUrl>https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt</PackageLicenseUrl>
<RepositoryUrl>https://github.com/jellyfin/jellyfin</RepositoryUrl>
</PropertyGroup>

View File

@ -6,6 +6,14 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup>
<Authors>Jellyfin Contributors</Authors>
<PackageId>Jellyfin.Data</PackageId>
<PackageVersion>10.7.0</PackageVersion>
<PackageLicenseUrl>https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt</PackageLicenseUrl>
<RepositoryUrl>https://github.com/jellyfin/jellyfin</RepositoryUrl>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

View File

@ -8,6 +8,7 @@
<PropertyGroup>
<Authors>Jellyfin Contributors</Authors>
<PackageId>Jellyfin.Common</PackageId>
<PackageVersion>10.7.0</PackageVersion>
<PackageLicenseUrl>https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt</PackageLicenseUrl>
<RepositoryUrl>https://github.com/jellyfin/jellyfin</RepositoryUrl>
</PropertyGroup>

View File

@ -8,6 +8,7 @@
<PropertyGroup>
<Authors>Jellyfin Contributors</Authors>
<PackageId>Jellyfin.Controller</PackageId>
<PackageVersion>10.7.0</PackageVersion>
<PackageLicenseUrl>https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt</PackageLicenseUrl>
<RepositoryUrl>https://github.com/jellyfin/jellyfin</RepositoryUrl>
</PropertyGroup>

View File

@ -8,6 +8,7 @@
<PropertyGroup>
<Authors>Jellyfin Contributors</Authors>
<PackageId>Jellyfin.Model</PackageId>
<PackageVersion>10.7.0</PackageVersion>
<PackageLicenseUrl>https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt</PackageLicenseUrl>
<RepositoryUrl>https://github.com/jellyfin/jellyfin</RepositoryUrl>
</PropertyGroup>

View File

@ -20,6 +20,12 @@ fi
shared_version_file="./SharedVersion.cs"
build_file="./build.yaml"
# csproj files for nuget packages
mediabrowser_common="MediaBrowser.Common/MediaBrowser.Common.csproj"
jellyfin_data="Jellyfin.Data/Jellyfin.Data.csproj"
mediabrowser_controller="MediaBrowser.Controller/MediaBrowser.Controller.csproj"
mediabrowser_model="MediaBrowser.Model/MediaBrowser.Model.csproj"
emby_naming="Emby.Naming/Emby.Naming.csproj"
new_version="$1"
@ -45,6 +51,23 @@ echo $old_version
old_version_sed="$( sed 's/\./\\./g' <<<"${old_version}" )" # Escape the '.' chars
sed -i "s/${old_version_sed}/${new_version}/g" ${build_file}
# update nuget package version
for f in ${mediabrowser_common} ${jellyfin_data} ${mediabrowser_controller} ${mediabrowser_model} ${emby_naming}
do
code ${f}
echo ${f}
# Parse the version from the *.csproj file
old_version="$(
grep "PackageVersion" ${f} \
| awk '{$1=$1};1' \
| sed -E 's/<PackageVersion>([0-9\.]+[-a-z0-9]*)<\/PackageVersion>/\1/'
)"
echo old nuget version: $old_version
# Set the nuget version to the specified new_version
sed -i "s|${old_version}|${new_version}|g" ${f}
done
if [[ ${new_version} == *"-"* ]]; then
new_version_deb="$( sed 's/-/~/g' <<<"${new_version}" )"
else