|
| 1 | +trigger: none # We only want to trigger manually or based on resources |
| 2 | +pr: none |
| 3 | + |
| 4 | +resources: |
| 5 | + pipelines: |
| 6 | + - pipeline: CI |
| 7 | + source: Nerdbank.Streams |
| 8 | + trigger: |
| 9 | + tags: |
| 10 | + - auto-release |
| 11 | + |
| 12 | +stages: |
| 13 | +- stage: GitHubRelease |
| 14 | + displayName: GitHub Release |
| 15 | + jobs: |
| 16 | + - deployment: create |
| 17 | + pool: |
| 18 | + vmImage: ubuntu-latest |
| 19 | + environment: No-Approval |
| 20 | + strategy: |
| 21 | + runOnce: |
| 22 | + deploy: |
| 23 | + steps: |
| 24 | + - download: none |
| 25 | + - powershell: | |
| 26 | + Write-Host "##vso[build.updatebuildnumber]$(resources.pipeline.CI.runName)" |
| 27 | + displayName: Set pipeline name |
| 28 | + - task: GitHubRelease@1 |
| 29 | + displayName: GitHub release (create) |
| 30 | + inputs: |
| 31 | + gitHubConnection: GitHub AArnott |
| 32 | + repositoryName: $(Build.Repository.Name) |
| 33 | + target: $(resources.pipeline.CI.sourceCommit) |
| 34 | + tagSource: userSpecifiedTag |
| 35 | + tag: v$(resources.pipeline.CI.runName) |
| 36 | + title: v$(resources.pipeline.CI.runName) |
| 37 | + isDraft: true |
| 38 | + changeLogCompareToRelease: lastNonDraftRelease |
| 39 | + changeLogType: issueBased |
| 40 | + changeLogLabels: | |
| 41 | + [ |
| 42 | + { "label" : "bug", "displayName" : "Fixes", "state" : "closed" }, |
| 43 | + { "label" : "enhancement", "displayName": "Enhancements", "state" : "closed" } |
| 44 | + ] |
| 45 | +
|
| 46 | +- stage: nuget_org |
| 47 | + displayName: nuget.org |
| 48 | + dependsOn: GitHubRelease |
| 49 | + jobs: |
| 50 | + - deployment: push |
| 51 | + pool: |
| 52 | + vmImage: ubuntu-latest |
| 53 | + environment: No-Approval |
| 54 | + strategy: |
| 55 | + runOnce: |
| 56 | + deploy: |
| 57 | + steps: |
| 58 | + - download: CI |
| 59 | + artifact: deployables-Windows |
| 60 | + displayName: Download deployables-Windows artifact |
| 61 | + patterns: 'deployables-Windows/NuGet/*' |
| 62 | + - task: NuGetToolInstaller@1 |
| 63 | + displayName: Use NuGet 5.x |
| 64 | + inputs: |
| 65 | + versionSpec: 5.x |
| 66 | + - task: NuGetCommand@2 |
| 67 | + displayName: NuGet push |
| 68 | + inputs: |
| 69 | + command: push |
| 70 | + packagesToPush: $(Pipeline.Workspace)/CI/deployables-Windows/NuGet/*.nupkg |
| 71 | + nuGetFeedType: external |
| 72 | + publishFeedCredentials: nuget.org |
| 73 | + |
| 74 | +- stage: npmjs_org |
| 75 | + displayName: npmjs.org |
| 76 | + dependsOn: GitHubRelease |
| 77 | + jobs: |
| 78 | + - deployment: push |
| 79 | + pool: |
| 80 | + vmImage: ubuntu-latest |
| 81 | + environment: No-Approval |
| 82 | + strategy: |
| 83 | + runOnce: |
| 84 | + deploy: |
| 85 | + steps: |
| 86 | + - download: CI |
| 87 | + artifact: deployables-Windows |
| 88 | + displayName: Download deployables-Windows artifact |
| 89 | + patterns: 'deployables-Windows/npm/*' |
| 90 | + - powershell: | |
| 91 | + $tgz = (Get-ChildItem "$(Pipeline.Workspace)/CI/deployables-Windows/npm/*.tgz")[0].FullName |
| 92 | +
|
| 93 | + npm init -y |
| 94 | + npm install $tgz |
| 95 | + workingDirectory: $(Agent.TempDirectory) |
| 96 | + displayName: Prepare to publish TGZ |
| 97 | + - task: Npm@1 |
| 98 | + displayName: npm publish |
| 99 | + inputs: |
| 100 | + command: publish |
| 101 | + workingDir: $(Agent.TempDirectory)/node_modules/nerdbank-streams |
| 102 | + verbose: false |
| 103 | + publishEndpoint: npmjs.org |
0 commit comments