Skip to content

Commit 482384c

Browse files
committed
Work CI-CD
- Fix check for update dependents. - Move task to after creation of github release. ***NO_CI***
1 parent 61a0a8a commit 482384c

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed

azure-pipelines.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,20 @@ jobs:
8080
- task: DotNetCoreCLI@2
8181
displayName: Install NBGV tool
8282
condition: >-
83-
or(
84-
eq(variables['StartReleaseCandidate'], true),
85-
ne(variables['system.pullrequest.isfork'], true)
83+
and(
84+
eq( variables['StartReleaseCandidate'], false),
85+
or(
86+
eq(variables['StartReleaseCandidate'], true),
87+
ne(variables['system.pullrequest.isfork'], true)
88+
)
8689
)
8790
inputs:
8891
command: custom
8992
custom: tool
9093
arguments: install -g nbgv
9194

9295
- task: PowerShell@2
93-
condition: eq( variables['StartReleaseCandidate'], true )
96+
condition: eq( variables['StartReleaseCandidate'], true)
9497
displayName: NBGV prepare release
9598
inputs:
9699
targetType: 'inline'
@@ -175,6 +178,7 @@ jobs:
175178
buildPlatform: 'x64'
176179
buildConfiguration: 'Release'
177180
solution: 'nanoFirmwareFlasher.sln'
181+
run_update_dependents: dependencies.Check_Build_Options.outputs['BuildOptions.RUN_UPDATE_DEPENDENTS']
178182

179183
steps:
180184

@@ -205,7 +209,7 @@ jobs:
205209
arguments: install -g nbgv
206210

207211
# only required when updating dependents
208-
- script: nbgv cloud
212+
- script: nbgv cloud -a -c
209213
condition: eq(variables['UPDATE_DEPENDENTS'], 'true')
210214
displayName: Set Could Version
211215

@@ -384,23 +388,6 @@ jobs:
384388
packagesToPush: '$(Build.ArtifactStagingDirectory)\nanoFramework.Tools.FirmwareFlasher.$(NBGV_NuGetPackageVersion).nupkg'
385389
publishFeedCredentials: 'NuGet-nanoFirmwareFlasher'
386390

387-
# update dependencies
388-
- task: PowerShell@2
389-
condition: >-
390-
and(
391-
or(
392-
eq(variables['UPDATE_DEPENDENTS'], 'true'),
393-
eq(variables['RUN_UPDATE_DEPENDENTS'], 'true')
394-
),
395-
not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
396-
)
397-
displayName: Update dependent tools
398-
inputs:
399-
targetType: filePath
400-
filePath: azure-pipelines/update-dependencies.ps1
401-
env:
402-
MY_GITHUB_TOKEN: $(GitHubToken)
403-
404391
# create or update GitHub release
405392
- task: GithubRelease@1
406393
condition: >-
@@ -444,6 +431,23 @@ jobs:
444431
addChangeLog: false
445432
action: edit
446433

434+
# update dependencies
435+
- task: PowerShell@2
436+
condition: >-
437+
and(
438+
or(
439+
eq(variables['UPDATE_DEPENDENTS'], 'true'),
440+
eq(variables['RUN_UPDATE_DEPENDENTS'], 'true')
441+
),
442+
not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
443+
)
444+
displayName: Update dependent tools
445+
inputs:
446+
targetType: filePath
447+
filePath: azure-pipelines/update-dependencies.ps1
448+
env:
449+
MY_GITHUB_TOKEN: $(GitHubToken)
450+
447451
##################################
448452
# report build failure to Discord
449453
- job: Report_Build_Failure

azure-pipelines/update-dependencies.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ git checkout --quiet develop | Out-Null
4141
Write-Host "Updating nanoFramework.Tools.FirmwareFlasher version in VS Code extension..."
4242

4343
$versionRegex = "nanoFlasherVersion\s=\s\""v\d+.\d+.\d+\"""
44-
$newVersion = "nanoFlasherVersion = ""$packageTargetVersion"""
44+
$newVersion = "nanoFlasherVersion = ""v$packageTargetVersion"""
4545

4646
$buildFileName = 'scripts/build.ps1'
4747
$buildFileContent = Get-Content $buildFileName -Encoding UTF8

version.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
"^refs/heads/v\\d+(?:\\.\\d+)?$"
1414
],
1515
"cloudBuild": {
16+
"setVersionVariables": true,
1617
"setAllVariables": true,
1718
"buildNumber": {
1819
"enabled": true,
19-
"includeCommitId": { "when": "always" }
20+
"includeCommitId": { "when": "nonPublicReleaseOnly" }
2021
}
2122
},
2223
"release": {

0 commit comments

Comments
 (0)