Skip to content

Commit

Permalink
Merge pull request #148 from AArnott/pipelineUpdates
Browse files Browse the repository at this point in the history
Pipeline updates
  • Loading branch information
AArnott authored Mar 31, 2022
2 parents 3aeff33 + 52dcdc7 commit 2838df2
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 73 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BuildConfiguration: Release
codecov_token: 4dc9e7e2-6b01-4932-a180-847b52b43d35 # Get a new one from https://codecov.io/
ci_feed: CI # Azure Artifacts feed name
ci_feed: https://pkgs.dev.azure.com/andrewarnott/_packaging/CI/nuget/v3/index.json # Azure Artifacts feed URL
NUGET_PACKAGES: $(Agent.TempDirectory)/.nuget/packages

jobs:
Expand Down
13 changes: 1 addition & 12 deletions azure-pipelines/publish-deployables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ steps:
displayName: Download deployables
artifact: deployables-Windows

- task: NuGetToolInstaller@1
displayName: Use NuGet 5.x
inputs:
versionSpec: 5.x

- task: NuGetCommand@2
- script: dotnet nuget push $(Pipeline.Workspace)/deployables-Windows/*.nupkg -s $(ci_feed) -k azdo --skip-duplicate
displayName: Push packages to CI feed
inputs:
command: push
packagesToPush: $(Pipeline.Workspace)/deployables-Windows/*.nupkg
nuGetFeedType: internal
publishVstsFeed: $(ci_feed)
allowPackageConflicts: true
condition: and(succeeded(), ne(variables['ci_feed'], ''), ne(variables['Build.Reason'], 'PullRequest'))
107 changes: 47 additions & 60 deletions azure-pipelines/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,64 +9,51 @@ resources:
tags:
- auto-release

stages:
- stage: GitHubRelease
displayName: GitHub Release
jobs:
- deployment: create
pool:
vmImage: ubuntu-latest
environment: No-Approval
strategy:
runOnce:
deploy:
steps:
- download: none
- powershell: |
Write-Host "##vso[build.updatebuildnumber]$(resources.pipeline.CI.runName)"
displayName: Set pipeline name
- task: GitHubRelease@1
displayName: GitHub release (create)
inputs:
gitHubConnection: # TODO: fill in service connection here
repositoryName: $(Build.Repository.Name)
target: $(resources.pipeline.CI.sourceCommit)
tagSource: userSpecifiedTag
tag: v$(resources.pipeline.CI.runName)
title: v$(resources.pipeline.CI.runName)
isDraft: true # After running this step, visit the new draft release, edit, and publish.
changeLogCompareToRelease: lastNonDraftRelease
changeLogType: issueBased
changeLogLabels: |
[
{ "label" : "bug", "displayName" : "Fixes", "state" : "closed" },
{ "label" : "enhancement", "displayName": "Enhancements", "state" : "closed" }
]
variables:
- group: Publishing secrets

- stage: nuget_org
displayName: nuget.org
dependsOn: GitHubRelease
jobs:
- deployment: push
pool:
vmImage: ubuntu-latest
environment: No-Approval
strategy:
runOnce:
deploy:
steps:
- download: CI
artifact: deployables-Windows
displayName: Download deployables-Windows artifact
patterns: 'deployables-Windows/*'
- task: NuGetToolInstaller@1
displayName: Use NuGet 5.x
inputs:
versionSpec: 5.x
- task: NuGetCommand@2
displayName: NuGet push
inputs:
command: push
packagesToPush: $(Pipeline.Workspace)/CI/deployables-Windows/*.nupkg
nuGetFeedType: external
publishFeedCredentials: # TODO: fill in service connection here
jobs:
- job: release
pool:
vmImage: ubuntu-latest
steps:
- checkout: none
- powershell: |
Write-Host "##vso[build.updatebuildnumber]$(resources.pipeline.CI.runName)"
if ('$(resources.pipeline.CI.runName)'.Contains('-')) {
Write-Host "##vso[task.setvariable variable=IsPrerelease]true"
} else {
Write-Host "##vso[task.setvariable variable=IsPrerelease]false"
}
displayName: Set up pipeline
- task: UseDotNet@2
displayName: Install .NET SDK
inputs:
packageType: sdk
version: 6.x
- download: CI
artifact: deployables-Windows
displayName: Download deployables-Windows artifact
patterns: 'deployables-Windows/*'
- task: GitHubRelease@1
displayName: GitHub release (create)
inputs:
gitHubConnection: # TODO: fill in service connection here
repositoryName: $(Build.Repository.Name)
target: $(resources.pipeline.CI.sourceCommit)
tagSource: userSpecifiedTag
tag: v$(resources.pipeline.CI.runName)
title: v$(resources.pipeline.CI.runName)
isDraft: true # After running this step, visit the new draft release, edit, and publish.
isPreRelease: $(IsPrerelease)
assets: $(Pipeline.Workspace)/CI/deployables-Windows/*.nupkg
changeLogCompareToRelease: lastNonDraftRelease
changeLogType: issueBased
changeLogLabels: |
[
{ "label" : "bug", "displayName" : "Fixes", "state" : "closed" },
{ "label" : "enhancement", "displayName": "Enhancements", "state" : "closed" }
]
- script: dotnet nuget push $(Pipeline.Workspace)/CI/deployables-Windows/*.nupkg -s https://api.nuget.org/v3/index.json --api-key $(NuGetOrgApiKey) --skip-duplicate
displayName: Push nuget packages
condition: and(succeeded(), ne(variables['NuGetOrgApiKey'], ''))

0 comments on commit 2838df2

Please sign in to comment.