Skip to content

Commit df5bf0e

Browse files
committed
Work CI-CD
- Split nuget push tasks. - Replace push command with custom one to circumvent lack of timeout option in Azure task. - Github releases do not upload assets anymore. (these changes are related with the fact that the nuget packages got really big) ** Requires adding NuGetToken secret variable to the pipeline **
1 parent 6e0d6a5 commit df5bf0e

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

azure-pipelines.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,27 @@ jobs:
260260
ArtifactName: deployables
261261
ArtifactType: Container
262262

263-
# push NuGet class lib package to NuGet (happens on all builds except PRs)
264-
- task: NuGetCommand@2
263+
# push NuGet packages to NuGet (happens on all builds except PRs)
264+
- task: DotNetCoreCLI@2
265265
condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
266-
displayName: Push NuGet packages to NuGet
267-
continueOnError: true
266+
displayName: Push NuGet nanoff package to NuGet
268267
inputs:
269-
command: push
270-
nuGetFeedType: external
271-
allowPackageConflicts: true
272-
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
273-
publishFeedCredentials: 'NuGet-nanoFirmwareFlasher'
268+
command: custom
269+
custom: nuget
270+
arguments: push $(Build.ArtifactStagingDirectory)/nanoff.$(NBGV_NuGetPackageVersion).nupkg --source https://api.nuget.org/v3/index.json --api-key $(API_KEY) --skip-duplicate --timeout 600
271+
env:
272+
API_KEY: $(NuGetToken)
274273

274+
- task: DotNetCoreCLI@2
275+
condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
276+
displayName: Push NuGet packages to NuGet
277+
inputs:
278+
command: custom
279+
custom: nuget
280+
arguments: push $(Build.ArtifactStagingDirectory)/nanoFramework.Tools.FirmwareFlasher.$(NBGV_NuGetPackageVersion).nupkg --source https://api.nuget.org/v3/index.json --api-key $(API_KEY) --skip-duplicate --timeout 600
281+
env:
282+
API_KEY: $(NuGetToken)
283+
275284
# create or update GitHub release
276285
- task: GithubRelease@1
277286
condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
@@ -283,8 +292,7 @@ jobs:
283292
title: 'nano firmware flasher v$(MY_NUGET_VERSION)'
284293
releaseNotesSource: inline
285294
releaseNotesInline: 'add description here'
286-
assets: '$(Build.ArtifactStagingDirectory)/*.nupkg'
287-
assetUploadMode: replace
295+
assets: ''
288296
isPreRelease: true
289297
addChangeLog: false
290298

@@ -299,8 +307,7 @@ jobs:
299307
title: 'nano firmware flasher v$(MY_NUGET_VERSION)'
300308
releaseNotesSource: inline
301309
releaseNotesInline: 'add description here'
302-
assets: '$(Build.ArtifactStagingDirectory)/*.nupkg'
303-
assetUploadMode: replace
310+
assets: ''
304311
isPreRelease: false
305312
addChangeLog: false
306313
action: edit

0 commit comments

Comments
 (0)