Skip to content

Create and publish .NET NuGet packages. - #8576

Merged
rolfbjarne merged 4 commits into
masterfrom
dotnet-create-nugets-v3
May 13, 2020
Merged

Create and publish .NET NuGet packages.#8576
rolfbjarne merged 4 commits into
masterfrom
dotnet-create-nugets-v3

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Create the various NuGet packages to support .NET 5+. The packages are
currently empty (and not very useful), but the actual content will come later.

The current set of NuGet packages are (this list is duplicated for each
platform: iOS, tvOS, watchOS and macOS):

  • Microsoft.iOS.Sdk: currently contains the basic MSBuild targets files for an
    MSBuild Project SDK. Will eventually contain all the build logic. Might also
    eventually contain other tools (mlaunch, bgen, etc.), but these might also
    end up in a different package.
  • Microsoft.iOS.Ref: will contain the Xamarin.iOS.dll reference assembly.
  • Microsoft.iOS.Runtime.[RID]: will contain architecture-specific files
    (libxamarin*.dylib, the Xamarin.iOS.dll implementation assembly, etc.):

The NuGets built on CI are automatically published to a NuGet feed.

The versioning for the NuGet packages required a few changes: OS bumps are now
changed in Make.versions instead of Make.config (this is explained in the
files themselves as well).

Create the various NuGet packages to support .NET 5+. The packages are
currently empty (and not very useful), but the actual content will come later.

The current set of NuGet packages are (this list is duplicated for each
platform: iOS, tvOS, watchOS and macOS):

* Microsoft.iOS.Sdk: currently contains the basic MSBuild targets files for an
  MSBuild Project SDK. Will eventually contain all the build logic. Might also
  eventually contain other tools (mlaunch, bgen, etc.), but these might also
  end up in a different package.
* Microsoft.iOS.Ref: will contain the Xamarin.iOS.dll reference assembly.
* Microsoft.iOS.Runtime.[RID]: will contain architecture-specific files
  (libxamarin*.dylib, the Xamarin.iOS.dll implementation assembly, etc.):

The NuGets built on CI are automatically published to a NuGet feed.

The versioning for the NuGet packages required a few changes: OS bumps are now
changed in Make.versions instead of Make.config (this is explained in the
files themselves as well).
@rolfbjarne rolfbjarne added the not-notes-worthy Ignore for release notes label May 12, 2020
@rolfbjarne

Copy link
Copy Markdown
Member Author

Test failures are unrelated

@monojenkins

This comment has been minimized.

Comment thread Make.config
@printf "IOS_NUGET_COMMIT_DISTANCE:=$(shell LANG=C; export LANG; git --git-dir $(TOP)/.git log `git --git-dir $(TOP)/.git blame -- ./Make.versions HEAD | grep IOS_NUGET_VERSION= | sed 's/ .*//' `..HEAD --oneline | wc -l | sed 's/ //g')\n" >> $@
@printf "TVOS_NUGET_COMMIT_DISTANCE:=$(shell LANG=C; export LANG; git --git-dir $(TOP)/.git log `git --git-dir $(TOP)/.git blame -- ./Make.versions HEAD | grep TVOS_NUGET_VERSION= | sed 's/ .*//' `..HEAD --oneline | wc -l | sed 's/ //g')\n" >> $@
@printf "WATCHOS_NUGET_COMMIT_DISTANCE:=$(shell LANG=C; export LANG; git --git-dir $(TOP)/.git log `git --git-dir $(TOP)/.git blame -- ./Make.versions HEAD | grep WATCHOS_NUGET_VERSION= | sed 's/ .*//' `..HEAD --oneline | wc -l | sed 's/ //g')\n" >> $@
@printf "MACOS_NUGET_COMMIT_DISTANCE:=$(shell LANG=C; export LANG; git --git-dir $(TOP)/.git log `git --git-dir $(TOP)/.git blame -- ./Make.versions HEAD | grep MACOS_NUGET_VERSION= | sed 's/ .*//' `..HEAD --oneline | wc -l | sed 's/ //g')\n" >> $@

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evil question, can you use a template for this? It just changes the grep param, correct?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things change: the grep parameter and the output variable. I'm not sure using a template is a net win in terms of code size, since it's only 6 lines of duplication. If something should be done it's probably to extract the logic for the whole target into a shell script, which would also make it possible to not run git blame 6 times, which a template wouldn't do. In any case, that's unrelated to this PR and can be done later.

# push
for nuget in "${NUGETS[@]}"; do
nuget="$(realpath "$nuget")"
nuget push "$nuget" -Source FEEDME -ApiKey WHATEVER -NonInteractive "${VERBOSITY[@]}" -ConfigFile $CONFIG_FILE

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the diff between this and using 'dotnet nuget push' ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There doesn't seem to be a difference as far as I can tell.

@rolfbjarne rolfbjarne added the build-package Build (and create package) on internal Jenkins. Apply 'run-internal-tests' to run tests too. label May 13, 2020
@monojenkins

This comment has been minimized.

@monojenkins

This comment has been minimized.

@monojenkins

Copy link
Copy Markdown
Contributor

Build success
Provisioning succeeded
Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
Test run succeeded

@xamarin-release-manager

This comment has been minimized.

@xamarin-release-manager

This comment has been minimized.

@xamarin-release-manager

Copy link
Copy Markdown
Collaborator

Build was (probably) aborted

🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Running XM tests on '10.9'' 🔥 : hudson.AbortException: Xamarin.Mac tests on macOS 10.9 failed (xammac_tests)

Provisioning succeeded
Build succeeded
✅ Packages:

API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
ℹ️ Test run skipped: Not running tests here because they're run on public Jenkins.
🔥 Xamarin.Mac tests on 10.9 failed: Xamarin.Mac tests on macOS 10.9 failed (xammac_tests) 🔥

@rolfbjarne

Copy link
Copy Markdown
Member Author

Test failure is unrelated:

@rolfbjarne
rolfbjarne merged commit 5834572 into master May 13, 2020
@rolfbjarne
rolfbjarne deleted the dotnet-create-nugets-v3 branch May 13, 2020 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-package Build (and create package) on internal Jenkins. Apply 'run-internal-tests' to run tests too. not-notes-worthy Ignore for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants