From a61f6e3308dfc9f84fe2bdfab0194b75c041d2aa Mon Sep 17 00:00:00 2001 From: David Date: Thu, 13 Aug 2020 15:22:12 +0200 Subject: [PATCH] Fix nuget ci --- .ci/azure-pipelines-package.yml | 6 ++--- Emby.Naming/Emby.Naming.csproj | 1 + Jellyfin.Data/Jellyfin.Data.csproj | 8 +++++++ .../MediaBrowser.Common.csproj | 1 + .../MediaBrowser.Controller.csproj | 1 + MediaBrowser.Model/MediaBrowser.Model.csproj | 1 + bump_version | 23 +++++++++++++++++++ 7 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.ci/azure-pipelines-package.yml b/.ci/azure-pipelines-package.yml index 003d5baf0..c80ec7b0e 100644 --- a/.ci/azure-pipelines-package.yml +++ b/.ci/azure-pipelines-package.yml @@ -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: diff --git a/Emby.Naming/Emby.Naming.csproj b/Emby.Naming/Emby.Naming.csproj index c017e76c7..410492e67 100644 --- a/Emby.Naming/Emby.Naming.csproj +++ b/Emby.Naming/Emby.Naming.csproj @@ -23,6 +23,7 @@ Jellyfin Contributors Jellyfin.Naming + 10.7.0 https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt https://github.com/jellyfin/jellyfin diff --git a/Jellyfin.Data/Jellyfin.Data.csproj b/Jellyfin.Data/Jellyfin.Data.csproj index 8ce0f3848..979198353 100644 --- a/Jellyfin.Data/Jellyfin.Data.csproj +++ b/Jellyfin.Data/Jellyfin.Data.csproj @@ -6,6 +6,14 @@ true + + Jellyfin Contributors + Jellyfin.Data + 10.7.0 + https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt + https://github.com/jellyfin/jellyfin + + ../jellyfin.ruleset diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj index 7380f39fd..e7f9a5643 100644 --- a/MediaBrowser.Common/MediaBrowser.Common.csproj +++ b/MediaBrowser.Common/MediaBrowser.Common.csproj @@ -8,6 +8,7 @@ Jellyfin Contributors Jellyfin.Common + 10.7.0 https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt https://github.com/jellyfin/jellyfin diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 67f17f7a5..9686b4a72 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -8,6 +8,7 @@ Jellyfin Contributors Jellyfin.Controller + 10.7.0 https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt https://github.com/jellyfin/jellyfin diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 902e29b20..229a75a46 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -8,6 +8,7 @@ Jellyfin Contributors Jellyfin.Model + 10.7.0 https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt https://github.com/jellyfin/jellyfin diff --git a/bump_version b/bump_version index 1c943f691..1db1f4499 100755 --- a/bump_version +++ b/bump_version @@ -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/([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