|
| 1 | +trigger: none |
| 2 | +name: $(Date:yyyyMMdd).$(Rev:r) |
| 3 | +resources: |
| 4 | + pipelines: |
| 5 | + - pipeline: '_microsoftnode-api-dotnet' |
| 6 | + project: 'ISS' |
| 7 | + source: 'microsoft.node-api-dotnet' |
| 8 | + trigger: |
| 9 | + branches: |
| 10 | + include: |
| 11 | + - main |
| 12 | + repositories: |
| 13 | + - repository: CustomPipelineTemplates |
| 14 | + type: git |
| 15 | + name: 1ESPipelineTemplates/OfficePipelineTemplates |
| 16 | + ref: refs/tags/release |
| 17 | +extends: |
| 18 | + template: v1/Office.Official.PipelineTemplate.yml@CustomPipelineTemplates |
| 19 | + parameters: |
| 20 | + pool: |
| 21 | + name: Azure-Pipelines-1ESPT-ExDShared |
| 22 | + vmImage: windows-latest |
| 23 | + os: windows |
| 24 | + customBuildTags: |
| 25 | + - ES365AIMigrationTooling-BulkMigrated-Release |
| 26 | + stages: |
| 27 | + - stage: ms_react_native_nuget_publish |
| 28 | + displayName: Nuget ms/react-native feed |
| 29 | + jobs: |
| 30 | + - job: ms_react_native_nuget_job |
| 31 | + displayName: Publish Nuget to ms/react-native |
| 32 | + condition: succeeded() |
| 33 | + timeoutInMinutes: 0 |
| 34 | + templateContext: |
| 35 | + inputs: |
| 36 | + - input: pipelineArtifact |
| 37 | + pipeline: '_microsoftnode-api-dotnet' |
| 38 | + artifactName: 'published-packages' |
| 39 | + targetPath: '$(Pipeline.Workspace)/published-packages' |
| 40 | + steps: |
| 41 | + - task: 1ES.PublishNuGet@1 |
| 42 | + displayName: 'NuGet push' |
| 43 | + inputs: |
| 44 | + packageParentPath: '$(Pipeline.Workspace)/published-packages' |
| 45 | + packagesToPush: Microsoft.JavaScript.NodeApi.*.nupkg |
| 46 | + nuGetFeedType: external |
| 47 | + externalEndpoint: Nuget - ms/react-native-public |
| 48 | + - stage: ms_react_native_npm_publish |
| 49 | + displayName: npm ms/react-native feed |
| 50 | + jobs: |
| 51 | + - job: ms_react_native_npm_job |
| 52 | + displayName: Agent job |
| 53 | + condition: succeeded() |
| 54 | + timeoutInMinutes: 0 |
| 55 | + templateContext: |
| 56 | + inputs: |
| 57 | + - input: pipelineArtifact |
| 58 | + pipeline: '_microsoftnode-api-dotnet' |
| 59 | + artifactName: 'published-packages' |
| 60 | + targetPath: '$(Pipeline.Workspace)/published-packages' |
| 61 | + steps: |
| 62 | + - task: NodeTool@0 |
| 63 | + displayName: Use Node 20.x |
| 64 | + inputs: |
| 65 | + versionSpec: 20.x |
| 66 | + - task: CmdLine@2 |
| 67 | + displayName: Setup npmrc file for react-native feed |
| 68 | + inputs: |
| 69 | + script: | |
| 70 | + echo registry=https://pkgs.dev.azure.com/ms/_packaging/react-native/npm/registry/ > $(Pipeline.Workspace)\published-packages\.npmrc |
| 71 | + echo always-auth=true >> $(Pipeline.Workspace)\published-packages\.npmrc |
| 72 | + - task: npmAuthenticate@0 |
| 73 | + displayName: npm Authenticate .npmrc |
| 74 | + inputs: |
| 75 | + workingFile: $(Pipeline.Workspace)\published-packages\.npmrc |
| 76 | + customEndpoint: Npm - ms/react-native |
| 77 | + - task: CmdLine@2 |
| 78 | + displayName: npm publish to react-native feed |
| 79 | + inputs: |
| 80 | + script: | |
| 81 | + cd $(Pipeline.Workspace)\published-packages |
| 82 | + for %%i in (*.tgz) do npm publish %%i |
| 83 | + - stage: nuget_org_publish |
| 84 | + displayName: Nuget nuget.org feed |
| 85 | + jobs: |
| 86 | + - job: nuget_org_job |
| 87 | + displayName: Publish Nuget to nuget.org |
| 88 | + condition: succeeded() |
| 89 | + timeoutInMinutes: 0 |
| 90 | + templateContext: |
| 91 | + inputs: |
| 92 | + - input: pipelineArtifact |
| 93 | + pipeline: '_microsoftnode-api-dotnet' |
| 94 | + artifactName: 'published-packages' |
| 95 | + targetPath: '$(Pipeline.Workspace)/published-packages' |
| 96 | + steps: |
| 97 | + - task: AzureKeyVault@2 |
| 98 | + inputs: |
| 99 | + azureSubscription: ESRP-JSHost3 |
| 100 | + KeyVaultName: OGX-JSHost-KV |
| 101 | + SecretsFilter: 'OGX-JSHost-Nuget-org-API-key-Microsoft-JavaScript-NodeApi' |
| 102 | + RunAsPreJob: true |
| 103 | + - task: NuGetToolInstaller@1 |
| 104 | + displayName: 'Use NuGet' |
| 105 | + - script: 'nuget.exe SetApiKey $(OGX-JSHost-Nuget-org-API-key-Microsoft-JavaScript-NodeApi)' |
| 106 | + displayName: 'NuGet SetApiKey (nuget.org)' |
| 107 | + - script: dir /S $(Pipeline.Workspace)\published-packages |
| 108 | + displayName: Show directory contents |
| 109 | + - script: > |
| 110 | + nuget.exe push |
| 111 | + $(Pipeline.Workspace)\published-packages\Microsoft.JavaScript.NodeApi.*.nupkg |
| 112 | + -Source https://api.nuget.org/v3/index.json |
| 113 | + -SkipDuplicate |
| 114 | + -NonInteractive |
| 115 | + -Verbosity Detailed |
| 116 | + displayName: 'NuGet push (nuget.org)' |
0 commit comments