This commit is contained in:
Rolf Bjarne Kvinge 2022-10-06 14:01:27 +02:00
Родитель d8b991e0e6 273c2fa51a
Коммит fb97063227
23 изменённых файлов: 517 добавлений и 306 удалений

4
.github/workflows/autoformat2.yml поставляемый
Просмотреть файл

@ -20,7 +20,7 @@ jobs:
uses: actions/github-script@v6.3.1
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
@ -28,7 +28,7 @@ jobs:
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "autoformat"
})[0];
var download = await github.actions.downloadArtifact({
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,

28
.github/workflows/update-single-platform-branches.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,28 @@
name: Update single-platform release tests branches
on:
# allow triggering this action manually
workflow_dispatch:
# run every saturday (at noon UTC), so the builds occur during the weekend during lower CI load
schedule:
- cron: '0 12 * * 6'
jobs:
updateSinglePlatformBranches:
name: Merge main into single-platform release test branches
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Update branches'
run: |
set -ex
for platform in iOS tvOS MacCatalyst macOS; do
git checkout -b release/release-test-only-dotnet-$platform origin/release/release-test-only-dotnet-$platform
git merge origin/main
git push
done

Просмотреть файл

@ -110,9 +110,11 @@ package release:
$(Q) $(MAKE) -C $(TOP)/release release
# copy .pkg, .zip and *updateinfo to the packages directory to be uploaded to storage
$(Q) mkdir -p ../package
$(Q) $(CP) $(TOP)/release/*.pkg ../package
$(Q) $(CP) $(TOP)/release/*.zip ../package
$(Q) $(CP) $(TOP)/release/*updateinfo ../package
$(Q) echo "Output from 'make release':"
$(Q) ls -la $(TOP)/release | sed 's/^/ /'
$(Q) if test -n "$$(shopt -s nullglob; echo $(TOP)/release/*.pkg)"; then $(CP) $(TOP)/release/*.pkg ../package; fi
$(Q) if test -n "$$(shopt -s nullglob; echo $(TOP)/release/*.zip)"; then $(CP) $(TOP)/release/*.zip ../package; fi
$(Q) if test -n "$$(shopt -s nullglob; echo $(TOP)/release/*updateinfo)"; then $(CP) $(TOP)/release/*updateinfo ../package; fi
$(Q) echo "Packages:"
$(Q) ls -la ../package | sed 's/^/ /'

Просмотреть файл

@ -10,6 +10,12 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-emsdk -->
<add key="darc-pub-dotnet-emsdk-c3fc739" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-c3fc739c/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-c3fc739-5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-c3fc739c-5/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-c3fc739-4" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-c3fc739c-4/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-c3fc739-3" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-c3fc739c-3/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-c3fc739-2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-c3fc739c-2/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-c3fc739-1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-c3fc739c-1/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-emsdk -->
<!-- Begin: Package sources from dotnet-aspnetcore -->
<!-- End: Package sources from dotnet-aspnetcore -->

Просмотреть файл

@ -2726,5 +2726,14 @@ namespace Xamarin.Localization.MSBuild {
return ResourceManager.GetString("W7100", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unexpected extension &apos;{0}&apos; for native reference &apos;{1}&apos; in manifest &apos;{2}&apos;..
/// </summary>
public static string W7105 {
get {
return ResourceManager.GetString("W7105", resourceCulture);
}
}
}
}

Просмотреть файл

@ -1450,4 +1450,13 @@
* 'Remove', 'Boolean', 'String', 'StringArray'
</comment>
</data>
<data name="W7105" xml:space="preserve">
<value>Unexpected extension '{0}' for native reference '{1}' in manifest '{2}'.</value>
<comment>
{0}: file extension
{1}: path to a file
{2}: path to a file
</comment>
</data>
</root>

Просмотреть файл

@ -167,7 +167,12 @@ namespace Xamarin.MacDev.Tasks {
t = new TaskItem (Path.Combine (resources, name));
t.SetMetadata ("Kind", "Dynamic");
break;
case ".a": // static library
t = new TaskItem (Path.Combine (resources, name));
t.SetMetadata ("Kind", "Static");
break;
default:
Log.LogWarning (MSBStrings.W7105 /* Unexpected extension '{0}' for native reference '{1}' in manifest '{2}'. */, Path.GetExtension (name), name, manifest);
t = r;
break;
}

Просмотреть файл

@ -37,7 +37,7 @@ using NativeHandle = System.IntPtr;
namespace Foundation {
public partial class NSArray {
public partial class NSArray : IEnumerable<NSObject> {
//
// Creates an array with the elements; If the value passed is null, it
@ -429,5 +429,28 @@ namespace Foundation {
return null;
}
}
public TKey[] ToArray<TKey> () where TKey: class, INativeObject
{
var rv = new TKey [GetCount (Handle)];
for (var i = 0; i < rv.Length; i++)
rv [i] = GetItem<TKey> ((nuint) i);
return rv;
}
public NSObject[] ToArray ()
{
return ToArray<NSObject> ();
}
IEnumerator<NSObject> IEnumerable<NSObject>.GetEnumerator ()
{
return new NSFastEnumerator<NSObject> (this);
}
IEnumerator IEnumerable.GetEnumerator ()
{
return new NSFastEnumerator<NSObject> (this);
}
}
}

Просмотреть файл

@ -89,5 +89,10 @@ namespace Foundation {
return GetItem<TKey> ((nuint)idx);
}
}
public new TKey[] ToArray ()
{
return base.ToArray<TKey> ();
}
}
}

Просмотреть файл

@ -8,6 +8,7 @@
//
using System;
using System.Linq;
using Foundation;
using ObjCRuntime;
using Security;
@ -123,5 +124,37 @@ namespace MonoTouchFixtures.Foundation {
Assert.That (a.Handle, Is.Not.EqualTo (IntPtr.Zero), "Handle");
}
}
[Test]
public void ToArray ()
{
using (var a = NSArray.FromStrings (new string [1] { "abc" })) {
var arr = a.ToArray ();
Assert.AreEqual (1, arr.Length, "Length");
Assert.AreEqual ("abc", arr [0].ToString (), "Value");
}
}
[Test]
public void ToArray_T ()
{
using (var a = NSArray.FromStrings (new string [1] { "abc" })) {
var arr = a.ToArray<NSString> ();
Assert.AreEqual (1, arr.Length, "Length");
Assert.AreEqual ("abc", arr [0].ToString (), "Value");
}
}
[Test]
public void Enumerator ()
{
using (var a = NSArray.FromStrings (new string [1] { "abc" })) {
foreach (var item in a)
Assert.AreEqual ("abc", item.ToString (), "Value");
var list = a.ToList ();
Assert.AreEqual (1, list.Count (), "Length");
Assert.AreEqual ("abc", list [0].ToString (), "Value");
}
}
}
}

Просмотреть файл

@ -93,5 +93,29 @@ namespace MonoTouchFixtures.Foundation {
Assert.AreSame (str3, arr [2], "NSArray indexer");
}
}
[Test]
public void ToArray ()
{
using (var a = NSArray<NSString>.FromNSObjects ((NSString) "abc")) {
var arr = a.ToArray ();
NSString element = arr [0];
Assert.AreEqual (1, arr.Length, "Length");
Assert.AreEqual ("abc", arr [0].ToString (), "Value");
Assert.AreEqual ("abc", (string) element, "Value element");
}
}
[Test]
public void ToArray_T ()
{
using (var a = NSArray<NSString>.FromNSObjects ((NSString) "abc")) {
var arr = a.ToArray ();
NSString element = arr [0];
Assert.AreEqual (1, arr.Length, "Length");
Assert.AreEqual ("abc", arr [0].ToString (), "Value");
Assert.AreEqual ("abc", (string) element, "Value element");
}
}
}
}

Просмотреть файл

@ -38,7 +38,7 @@ namespace u2ignore {
}
}
var header = new string [] { "", $"# Initial result from new rule { id }" };
var header = new string [] { "", $"# Initial result from new rule {id}" };
foreach (var kvp in dict) {
var framework = kvp.Key;
var entries = kvp.Value;
@ -47,7 +47,7 @@ namespace u2ignore {
var failure = kvp2.Key;
var platforms = kvp2.Value;
string[] files;
string [] files;
if (platforms.Count == 4) {
// same failure in all platforms, the result goes into the common file.
files = new string [] { "common" };
@ -61,7 +61,7 @@ namespace u2ignore {
File.AppendAllLines (path, new string [] { "" });
File.AppendAllLines (path, header);
}
File.AppendAllLines (path, new string [] { failure } );
File.AppendAllLines (path, new string [] { failure });
}
}
}

Просмотреть файл

@ -3,7 +3,7 @@ using System.IO;
using Extrospection;
class Program {
static void Main (string[] args)
static void Main (string [] args)
{
var dir = args.Length == 0 ? "." : args [0];
foreach (var file in Directory.GetFiles (dir, "*.unclassified")) {

Просмотреть файл

@ -155,7 +155,7 @@ namespace Extrospection {
foreach (var file in Directory.GetFiles (directory, "*.todo")) {
if (!IsIncluded (file))
continue;
if (!(File.ReadLines(file).Count() > 0)) {
if (!(File.ReadLines (file).Count () > 0)) {
Log ($"?empty-todo? File '{Path.GetFileName (file)}' is empty. Empty todo files should be removed.");
}
}
@ -226,8 +226,8 @@ namespace Extrospection {
var common = kvp.Value;
//ExistingCommonEntries (common, $"common-{fx}.ignore");
List<string> [] raws = new List<string> [Platforms.Count];
for (int i=0; i < raws.Length; i++) {
var fname = Path.Combine (directory, $"{Platforms[i]}-{fx}.raw");
for (int i = 0; i < raws.Length; i++) {
var fname = Path.Combine (directory, $"{Platforms [i]}-{fx}.raw");
if (File.Exists (fname))
raws [i] = new List<string> (File.ReadAllLines (fname));
else

Просмотреть файл

@ -17,6 +17,11 @@ dotnet format whitespace "$SRC_DIR/msbuild/Xamarin.MacDev.Tasks/Xamarin.MacDev.T
dotnet format whitespace "$SRC_DIR/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.Tasks.Windows.csproj"
dotnet format whitespace "$SRC_DIR/msbuild/Xamarin.iOS.Tasks/Xamarin.iOS.Tasks.csproj"
dotnet format whitespace "$SRC_DIR/tools/dotnet-linker/dotnet-linker.csproj"
dotnet format whitespace "$SRC_DIR/tests/xtro-sharpie/xtro-sharpie.csproj"
dotnet format whitespace "$SRC_DIR/tests/xtro-sharpie/u2ignore/u2ignore.csproj"
dotnet format whitespace "$SRC_DIR/tests/xtro-sharpie/u2todo/u2todo.csproj"
dotnet format whitespace "$SRC_DIR/tests/xtro-sharpie/xtro-report/xtro-report.csproj"
dotnet format whitespace "$SRC_DIR/tests/xtro-sharpie/xtro-sanity/xtro-sanity.csproj"
# dotnet format "$SRC_DIR/[...]"
# add more projects here...

Просмотреть файл

@ -92,6 +92,59 @@ parameters:
type: stepList
default: []
- name: packages
type: object
default: [
{
job: prepare_packages,
displayName: 'Prepare packages',
packages: [
{
job: 'microsoft_ios_sign_notarize',
name: 'Microsoft.iOS',
pattern: 'Microsoft.iOS.Bundle*.pkg',
conditionVariable: "INCLUDE_DOTNET_IOS",
},
{
job: 'microsoft_tvos_sign_notarize',
name: 'Microsoft.tvOS',
pattern: 'Microsoft.tvOS.Bundle*.pkg',
conditionVariable: "INCLUDE_DOTNET_TVOS",
},
{
job: 'microsoft_mac_sign_notarize',
name: 'Microsoft.macOS',
pattern: 'Microsoft.macOS.Bundle*.pkg',
conditionVariable: "INCLUDE_DOTNET_MACOS",
},
{
job: 'microsoft_maccatalyst_sign_notarize',
name: 'Microsoft.MacCatalyst',
pattern: 'Microsoft.MacCatalyst.Bundle*.pkg',
conditionVariable: "INCLUDE_DOTNET_MACCATALYST",
},
],
},
{
job: prepare_packages_legacy,
displayName: 'Prepare legacy packages',
packages: [
{
job: 'xamarin_ios_sign_notarize',
name: 'Xamarin.iOS',
pattern: 'xamarin.ios-*',
conditionVariable: "INCLUDE_LEGACY_IOS",
},
{
job: 'xamarin_mac_sing_notarie',
name: 'Xamarin.Mac',
pattern: 'xamarin.mac-*',
conditionVariable: "INCLUDE_LEGACY_MAC",
},
],
}
]
stages:
- ${{ if eq(parameters.runGovernanceTests, true) }}:
@ -150,8 +203,9 @@ stages:
skipESRP: ${{ parameters.skipESRP }}
pool: ${{ parameters.pool }}
- stage: prepare_packages
displayName: 'Prepare packages'
- ${{ each pkg_obj in parameters.packages }}:
- stage: ${{ pkg_obj.job }}
displayName: ${{ pkg_obj.displayName }}
dependsOn:
- build_packages
jobs:
@ -162,6 +216,43 @@ stages:
keyringPass: $(pass--lab--mac--builder--keychain)
enableDotnet: ${{ parameters.enableDotnet }}
skipESRP: ${{ parameters.skipESRP }}
packages: ${{ pkg_obj.packages }}
- ${{ if eq(parameters.enableDotnet, true) }}:
- stage: sign_notarize_dotnet
displayName: 'Sign & Notarize Dotnet'
dependsOn:
- build_packages
jobs:
- template: ./sign-and-notarized/dotnet-signing.yml
parameters:
isPR: ${{ parameters.isPR }}
# .NET Release Prep and VS Insertion Stages, only execute them when the build comes from an official branch and is not a schedule build from OneLoc
# setting the stage at this level makes the graph of the UI look better, else the lines overlap and is not clear.
- ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), eq(variables['Build.SourceBranch'], 'refs/heads/net7.0'), eq(parameters.forceInsertion, true))) }}:
- template: ./release/vs-insertion-prep.yml
parameters:
dependsOn:
- sign_notarize_dotnet
isPR: ${{ parameters.isPR }}
- stage: funnel
displayName: 'Collect signed artifacts'
dependsOn:
- build_packages
- ${{ if eq(parameters.enableDotnet, true) }}:
- sign_notarize_dotnet
- ${{ each pkg_obj in parameters.packages }}:
- ${{ pkg_obj.job }}
jobs:
- template: ./sign-and-notarized/funnel.yml
parameters:
isPR: ${{ parameters.isPR }}
packages: # flatten the pkgs for the parameter
- ${{ each pkg_obj in parameters.packages }}:
- ${{ each pkg in pkg_obj.packages }}:
- ${{ pkg }}
- ${{ if eq(parameters.enableAPIDiff, true) }}:
- stage: generate_api_diff
@ -179,12 +270,6 @@ stages:
enableDotnet: ${{ parameters.enableDotnet }}
pool: ${{ parameters.pool }}
# .NET Release Prep and VS Insertion Stages, only execute them when the build comes from an official branch and is not a schedule build from OneLoc
- ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), eq(variables['Build.SourceBranch'], 'refs/heads/net7.0'), eq(parameters.forceInsertion, true))) }}:
- template: ./release/vs-insertion-prep.yml
parameters:
isPR: ${{ parameters.isPR }}
# Test stages
# always run simulator tests

Просмотреть файл

@ -4,8 +4,8 @@ parameters:
default: true
- name: dependsOn
type: string
default: prepare_packages
type: object
default: []
- name: isPR
type: boolean
@ -14,13 +14,13 @@ stages:
- stage: prepare_release
displayName: Prepare Release
dependsOn: ${{ parameters.dependsOn }}
condition: and(or(eq(dependencies.${{ parameters.dependsOn }}.result, 'Succeeded'), eq(dependencies.${{ parameters.dependsOn }}.result, 'SucceededWithIssues')), eq(${{ parameters.isPR }}, false), eq(${{ parameters.enableDotnet }}, true))
condition: and(eq(${{ parameters.isPR }}, false), eq(${{ parameters.enableDotnet }}, true))
jobs:
# Check - "xamarin-macios (Prepare Release Sign NuGets)"
- template: sign-artifacts/jobs/v2.yml@templates
parameters:
artifactName: package
artifactName: dotnet-signed
signType: Real
usePipelineArtifactTasks: true
@ -30,7 +30,7 @@ stages:
yamlResourceName: templates
dependsOn: signing
artifactName: nuget-signed
propsArtifactName: package
propsArtifactName: dotnet-signed
signType: Real
useDateTimeVersion: true

Просмотреть файл

@ -7,13 +7,32 @@ parameters:
- name: isPR
type: boolean
steps:
jobs:
- job: configure
displayName: 'Configure build'
pool:
vmImage: windows-latest
- template: setup.yml
steps:
- template: ../common/configure.yml
- job: sign_notarize_dotnet
dependsOn:
- configure
displayName: 'Sign & Notarize Dotnet'
timeoutInMinutes: 1000
pool:
vmImage: internal-macos-11
workspace:
clean: all
steps:
- template: setup.yml
parameters:
isPR: ${{ parameters.isPR }}
- task: DownloadPipelineArtifact@2
- task: DownloadPipelineArtifact@2
displayName: Download not notaraized build
inputs:
artifact: 'not-signed-package'
@ -21,7 +40,7 @@ steps:
allowFailedBuilds: true
path: $(Build.SourcesDirectory)/package
- ${{ if eq(parameters.isPR, false) }}:
- ${{ if eq(parameters.isPR, false) }}:
- pwsh : |
# Get the list of files to sign
$msiFiles = Get-ChildItem -Path $(Build.SourcesDirectory)/package/ -Filter "*.msi"
@ -53,7 +72,7 @@ steps:
displayName: 'Sign .msi'
condition: ${{ parameters.condition }}
- pwsh: |
- pwsh: |
mv $(Build.SourcesDirectory)/package/bundle.zip $(Build.ArtifactStagingDirectory)/not-signed-bundle.zip
$bundlePath = "$(Build.ArtifactStagingDirectory)/bundle"
unzip $(Build.ArtifactStagingDirectory)/not-signed-bundle.zip -d $bundlePath
@ -95,12 +114,12 @@ steps:
displayName: 'Sign bundle.zip'
workingDirectory: $(Build.ArtifactStagingDirectory)
- template: publish-nugets.yml
- template: publish-nugets.yml
parameters:
isPR: ${{ parameters.isPR }}
# always upload no matter what, since if we are not signing we need the artifact in the pipeline
- task: PublishPipelineArtifact@1
# always upload no matter what, since if we are not signing we need the artifact in the pipeline
- task: PublishPipelineArtifact@1
displayName: 'Publish Notarized Dotnet Artifacts'
inputs:
targetPath: $(Build.SourcesDirectory)/package

Просмотреть файл

@ -3,36 +3,71 @@ parameters:
- name: packages
type: object
steps:
- name: enableDotnet
type: boolean
default: true
# DO NOT USE THE checkout.yml template. The reason is that the template changes the hash which results in a problem with the artifacts scripts
- checkout: self # https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#checkout
- name: isPR
type: boolean
jobs:
- job: configure
displayName: 'Configure build'
pool:
vmImage: windows-latest
variables:
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
isScheduled: $[eq(variables['Build.Reason'], 'Schedule')]
steps:
- template: ../common/configure.yml
- job: funnel_job
dependsOn:
- configure
displayName: 'Collect signed artifacts'
condition: and(not(failed()), not(canceled())) # default is succeded(), but that fails if there are any skipped jobs, so change the condition to !failed && !cancelled
timeoutInMinutes: 1000
pool:
vmImage: internal-macos-11
workspace:
clean: all
variables:
${{ each pkg in parameters.packages }}:
${{ pkg.conditionVariable }}: $[ dependencies.configure.outputs['configure_platforms.${{ pkg.conditionVariable }}'] ]
steps:
# DO NOT USE THE checkout.yml template. The reason is that the template changes the hash which results in a problem with the artifacts scripts
- checkout: self # https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#checkout
clean: true # Executes: git clean -ffdx && git reset --hard HEAD
submodules: recursive
path: s/xamarin-macios
- checkout: maccore
- checkout: maccore
clean: true
persistCredentials: true # hugely important, else there are some scripts that check a single file from maccore that will fail
- checkout: templates
- checkout: templates
clean: true
- checkout: release-scripts
- checkout: release-scripts
clean: true
- bash: |
- bash: |
mkdir -p $(Build.SourcesDirectory)/package/notarized
displayName: 'Create target directories.'
- task: DownloadPipelineArtifact@2
- task: DownloadPipelineArtifact@2
displayName: Download notarized build dotnet
inputs:
artifact: 'dotnet-signed'
allowFailedBuilds: true
path: $(Build.SourcesDirectory)/package
- ${{ each pkg in parameters.packages }}:
- ${{ each pkg in parameters.packages }}:
- task: DownloadPipelineArtifact@2
displayName: Download notarized build ${{ pkg.name }}
condition: ne('', variables['${{ pkg.conditionVariable }}'])
@ -51,30 +86,77 @@ steps:
displayName: 'Move pkg ${{ pkg.name }} to its final destination'
condition: ne('', variables['${{ pkg.conditionVariable }}'])
- template: generate-workspace-info.yml@templates
- template: generate-workspace-info.yml@templates
parameters:
GitHubToken: $(GitHub.Token)
ArtifactDirectory: $(Build.SourcesDirectory)/package-internal
# download workload json and add it to out package internal dir, this allows the rest of jobs
# not to need several artifacts but just package-internal
- task: DownloadPipelineArtifact@2
# download workload json and add it to out package internal dir, this allows the rest of jobs
# not to need several artifacts but just package-internal
- task: DownloadPipelineArtifact@2
displayName: Download WorkloadRollback.json
inputs:
patterns: '**/WorkloadRollback.json'
allowFailedBuilds: true
path: $(Build.SourcesDirectory)/package-internal
- task: PublishPipelineArtifact@1
- task: PublishPipelineArtifact@1
displayName: 'Publish Build Internal Artifacts'
inputs:
targetPath: $(Build.SourcesDirectory)/package-internal
artifactName: package-internal
continueOnError: true
- task: PublishPipelineArtifact@1
- task: PublishPipelineArtifact@1
displayName: 'Publish Build Artifacts (notarized)'
inputs:
targetPath: $(Build.SourcesDirectory)/package
artifactName: package
continueOnError: true
# This job uploads the pkgs generated by the build step in the azure blob storage. This has to be done in a different job
# because the azure blob storate tools DO NOT work on mac OS meaning that we need a bot running Windows. build uploads the contents
# to the pipeline artefacts and we download and upload to azure in this job.
- job: upload_azure_blob
displayName: 'Upload packages to Azure & SBOM'
timeoutInMinutes: 1000
dependsOn:
- funnel_job
condition: and(not(failed()), not(canceled())) # default is succeded(), but that fails if there are any skipped jobs, so change the condition to !failed && !cancelled
variables:
Parameters.outputStorageUri: ''
NUGETS_PUBLISHED: $[ stageDependencies.sign_notarize_dotnet.sign_notarize_dotnet.outputs['nugetPublishing.NUGETS_PUBLISHED'] ] # not a typo, stage and job have the same name
SKIP_NUGETS: $[ dependencies.configure.outputs['labels.skip-nugets'] ]
pool:
vmImage: 'windows-latest'
workspace:
clean: all
steps:
- template: upload-azure.yml
parameters:
enableDotnet: ${{ parameters.enableDotnet }}
sbomFilter: '*.nupkg;*.pkg;*.msi'
# Job that runs on a vm that downloads the artifacts information and adds a github comment pointing to the results of the build.
- job: artifacts_github_comment
displayName: 'Publish GitHub Comment - Artifacts'
timeoutInMinutes: 1000
dependsOn:
- configure
- upload_azure_blob
condition: succeededOrFailed()
variables:
PR_ID: $[ dependencies.configure.outputs['labels.pr-number'] ]
BUILD_PACKAGE: $[ dependencies.configure.outputs['labels.build-package'] ]
TESTS_BOT: $[ stageDependencies.build_packages.build.outputs['build.TESTS_BOT'] ] # we build in a diff bot than the ones used for the comments
GIT_HASH: $[ stageDependencies.build_packages.build.outputs['fix_commit.GIT_HASH'] ]
pool:
vmImage: 'windows-latest'
workspace:
clean: all
steps:
- template: artifact-github-comment.yml
parameters:
isPR: ${{ parameters.isPR }}

Просмотреть файл

@ -20,44 +20,7 @@ parameters:
- name: packages
type: object
default: [
{
job: 'xamarin_ios_sign_notarize',
name: 'Xamarin.iOS',
pattern: 'xamarin.ios-*',
conditionVariable: "INCLUDE_LEGACY_IOS",
},
{
job: 'xamarin_mac_sing_notarie',
name: 'Xamarin.Mac',
pattern: 'xamarin.mac-*',
conditionVariable: "INCLUDE_LEGACY_MAC",
},
{
job: 'microsoft_ios_sign_notarize',
name: 'Microsoft.iOS',
pattern: 'Microsoft.iOS.Bundle*.pkg',
conditionVariable: "INCLUDE_DOTNET_IOS",
},
{
job: 'microsoft_tvos_sign_notarize',
name: 'Microsoft.tvOS',
pattern: 'Microsoft.tvOS.Bundle*.pkg',
conditionVariable: "INCLUDE_DOTNET_TVOS",
},
{
job: 'microsoft_mac_sign_notarize',
name: 'Microsoft.macOS',
pattern: 'Microsoft.macOS.Bundle*.pkg',
conditionVariable: "INCLUDE_DOTNET_MACOS",
},
{
job: 'microsoft_maccatalyst_sign_notarize',
name: 'Microsoft.MacCatalyst',
pattern: 'Microsoft.MacCatalyst.Bundle*.pkg',
conditionVariable: "INCLUDE_DOTNET_MACCATALYST",
},
]
default: []
jobs:
- job: configure
@ -93,90 +56,3 @@ jobs:
skipESRP: ${{ parameters.skipESRP }}
packageName: ${{ pkg.name }}
packagePattern: ${{ pkg.pattern }}
- ${{ if eq(parameters.enableDotnet, true) }}:
- job: sign_notarize_dotnet
dependsOn:
- configure
displayName: 'Sign & Notarize Dotnet'
timeoutInMinutes: 1000
pool:
vmImage: internal-macos-11
workspace:
clean: all
steps:
- template: dotnet-signing.yml
parameters:
isPR: ${{ parameters.isPR }}
- job: funnel_job
dependsOn:
- configure
- ${{ if eq(parameters.enableDotnet, true) }}:
- sign_notarize_dotnet
- ${{ each pkg in parameters.packages }}:
- ${{ pkg.job }}
displayName: 'Collect signed artifacts'
condition: and(not(failed()), not(canceled())) # default is succeded(), but that fails if there are any skipped jobs, so change the condition to !failed && !cancelled
timeoutInMinutes: 1000
pool:
vmImage: internal-macos-11
workspace:
clean: all
variables:
${{ each pkg in parameters.packages }}:
${{ pkg.conditionVariable }}: $[ dependencies.configure.outputs['configure_platforms.${{ pkg.conditionVariable }}'] ]
steps:
- template: funnel.yml
parameters:
packages: ${{ parameters.packages }}
# This job uploads the pkgs generated by the build step in the azure blob storage. This has to be done in a different job
# because the azure blob storate tools DO NOT work on mac OS meaning that we need a bot running Windows. build uploads the contents
# to the pipeline artefacts and we download and upload to azure in this job.
- job: upload_azure_blob
displayName: 'Upload packages to Azure & SBOM'
timeoutInMinutes: 1000
dependsOn:
- funnel_job
condition: and(not(failed()), not(canceled())) # default is succeded(), but that fails if there are any skipped jobs, so change the condition to !failed && !cancelled
variables:
Parameters.outputStorageUri: ''
NUGETS_PUBLISHED: $[ dependencies.sign_notarize.outputs['nugetPublishing.NUGETS_PUBLISHED'] ]
SKIP_NUGETS: $[ dependencies.configure.outputs['labels.skip-nugets'] ]
pool:
vmImage: 'windows-latest'
workspace:
clean: all
steps:
- template: upload-azure.yml
parameters:
enableDotnet: ${{ parameters.enableDotnet }}
sbomFilter: '*.nupkg;*.pkg;*.msi'
# Job that runs on a vm that downloads the artifacts information and adds a github comment pointing to the results of the build.
- job: artifacts_github_comment
displayName: 'Publish GitHub Comment - Artifacts'
timeoutInMinutes: 1000
dependsOn:
- configure
- upload_azure_blob
condition: succeededOrFailed()
variables:
PR_ID: $[ dependencies.configure.outputs['labels.pr-number'] ]
BUILD_PACKAGE: $[ dependencies.configure.outputs['labels.build-package'] ]
TESTS_BOT: $[ stageDependencies.build_packages.build.outputs['build.TESTS_BOT'] ] # we build in a diff bot than the ones used for the comments
GIT_HASH: $[ stageDependencies.build_packages.build.outputs['fix_commit.GIT_HASH'] ]
pool:
vmImage: 'windows-latest'
workspace:
clean: all
steps:
- template: artifact-github-comment.yml
parameters:
isPR: ${{ parameters.isPR }}