Skip to content

Commit 63efbb1

Browse files
committed
Work CI-CD
- Replace version setting to account for RC and main branches. - Replace master with main on branch names. - Bump version to 1.6.4.
1 parent d7951be commit 63efbb1

File tree

7 files changed

+26
-17
lines changed

7 files changed

+26
-17
lines changed

azure-pipelines-templates/build-chibios-stm32.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ steps:
88

99
- task: CMake@1
1010
inputs:
11-
cmakeArgs: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=CMake/toolchain.arm-none-eabi.cmake -DTOOLCHAIN_PREFIX=$(GNU_GCC_TOOLCHAIN_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_Version).$(TARGET_BUILD_COUNTER) -DTARGET_BOARD=$(TargetBoard) $(BuildOptions) -DTARGET_NAME=$(TargetPublishName) -DTOOL_HEX2DFU_PREFIX=$(HEX2DFU_PATH) ..'
11+
cmakeArgs: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=CMake/toolchain.arm-none-eabi.cmake -DTOOLCHAIN_PREFIX=$(GNU_GCC_TOOLCHAIN_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_BOARD=$(TargetBoard) $(BuildOptions) -DTARGET_NAME=$(TargetPublishName) -DTOOL_HEX2DFU_PREFIX=$(HEX2DFU_PATH) ..'
1212
workingDirectory: ${{ parameters.buildDirectory }}
1313
displayName: Setup build with CMake and DFU
1414
condition: eq(variables['NeedsDFU'], true)
1515

1616
- task: CMake@1
1717
inputs:
18-
cmakeArgs: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=CMake/toolchain.arm-none-eabi.cmake -DTOOLCHAIN_PREFIX=$(GNU_GCC_TOOLCHAIN_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_Version).$(TARGET_BUILD_COUNTER) -DTARGET_BOARD=$(TargetBoard) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions) ..'
18+
cmakeArgs: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=CMake/toolchain.arm-none-eabi.cmake -DTOOLCHAIN_PREFIX=$(GNU_GCC_TOOLCHAIN_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_BOARD=$(TargetBoard) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions) ..'
1919
workingDirectory: ${{ parameters.buildDirectory }}
2020
displayName: Setup build with CMake without DFU
2121
condition: eq(variables['NeedsDFU'], false)

azure-pipelines-templates/build-esp32.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ parameters:
88
steps:
99
- task: CMake@1
1010
inputs:
11-
cmakeArgs: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=CMake/toolchain.xtensa-esp32-elf.cmake -DTOOLCHAIN_PREFIX=$(ESP32_TOOLCHAIN_PATH) -DESP32_IDF_PATH=$(ESP32_IDF_PATH) -DESP32_LIBS_PATH=$(ESP32_LIBS_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_Version).$(TARGET_BUILD_COUNTER) -DTARGET_BOARD=$(TargetBoard) $(BuildOptions) ..'
11+
cmakeArgs: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=CMake/toolchain.xtensa-esp32-elf.cmake -DTOOLCHAIN_PREFIX=$(ESP32_TOOLCHAIN_PATH) -DESP32_IDF_PATH=$(ESP32_IDF_PATH) -DESP32_LIBS_PATH=$(ESP32_LIBS_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_BOARD=$(TargetBoard) $(BuildOptions) ..'
1212
workingDirectory: ${{ parameters.buildDirectory }}
1313
displayName: Setup build with CMake
1414

azure-pipelines-templates/build-freertos-nxp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ steps:
88

99
- task: CMake@1
1010
inputs:
11-
cmakeArgs: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=CMake/toolchain.arm-none-eabi.cmake -DTOOLCHAIN_PREFIX=$(GNU_GCC_TOOLCHAIN_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_Version).$(TARGET_BUILD_COUNTER) -DTARGET_BOARD=$(TargetBoard) -DTARGET_NAME=$(TargetPublishName) -DTOOL_SRECORD_PREFIX=$(SRECORD_PATH)/srecord/ $(BuildOptions) ..'
11+
cmakeArgs: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=CMake/toolchain.arm-none-eabi.cmake -DTOOLCHAIN_PREFIX=$(GNU_GCC_TOOLCHAIN_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_BOARD=$(TargetBoard) -DTARGET_NAME=$(TargetPublishName) -DTOOL_SRECORD_PREFIX=$(SRECORD_PATH)/srecord/ $(BuildOptions) ..'
1212
workingDirectory: ${{ parameters.buildDirectory }}
1313
displayName: Setup build with CMake
1414

azure-pipelines-templates/build-ti-simplelink.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ steps:
88

99
- task: CMake@1
1010
inputs:
11-
cmakeArgs: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=CMake/toolchain.arm-none-eabi.cmake -DTOOLCHAIN_PREFIX=$(GNU_GCC_TOOLCHAIN_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_Version).$(TARGET_BUILD_COUNTER) -DTARGET_BOARD=$(TargetBoard) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions) ..'
11+
cmakeArgs: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=CMake/toolchain.arm-none-eabi.cmake -DTOOLCHAIN_PREFIX=$(GNU_GCC_TOOLCHAIN_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_BOARD=$(TargetBoard) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions) ..'
1212
workingDirectory: ${{ parameters.buildDirectory }}
1313
displayName: Setup build with CMake
1414

azure-pipelines-templates/nb-gitversioning.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,13 @@ steps:
3838
$counter = $env:REVISION
3939
$version = ([int]$counter).ToString()
4040
41-
Write-Host "$("##vso[task.setvariable variable=TARGET_BUILD_COUNTER]")$version"
41+
if($env:Build_SourceBranch.StartsWith('release-') -or
42+
$env:Build_SourceBranch.StartsWith('main'))
43+
{
44+
Write-Host "$("##vso[task.setvariable variable=TARGET_BUILD_COUNTER]")$env:NBGV_BuildNumber"
45+
}
46+
else
47+
{
48+
Write-Host "$("##vso[task.setvariable variable=TARGET_BUILD_COUNTER]")$version"
49+
}
50+

azure-pipelines.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
trigger:
22
branches:
3-
include: ["main", "master", "develop*", "release-*", "refs/tags/*" ]
3+
include: ["main", "main", "develop*", "release-*", "refs/tags/*" ]
44
paths:
55
exclude: [ "doc", "*.md", ".gitignore", "README.md" ]
66

@@ -205,7 +205,7 @@ jobs:
205205
$branch = $release.Split(' ')[0]
206206
207207
# start PR for release
208-
$prRequestBody = @{title="Release $branch";body="";head="$branch";base="master"} | ConvertTo-Json
208+
$prRequestBody = @{title="Release $branch";body="";head="$branch";base="main"} | ConvertTo-Json
209209
$githubApiEndpoint = "https://api.github.com/repos/$env:Build_Repository_Name/pulls"
210210
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
211211
@@ -469,7 +469,7 @@ jobs:
469469
- task: NuGetToolInstaller@0
470470
inputs:
471471
versionSpec: '5.8.0'
472-
displayName: 'Install specifc version of NuGet'
472+
displayName: 'Install specific version of NuGet'
473473

474474
- task: VSBuild@1
475475
inputs:
@@ -587,7 +587,7 @@ jobs:
587587
- Build_NXP_targets
588588
- Build_TI_SimpleLink_targets
589589
# skip build if this is a PR, submitted by nfbot and the commit message contains [version update]
590-
condition: and( succeeded('Build_STM32_targets'), succeeded('Build_ESP32_targets'), succeeded('Build_NXP_targets'), succeeded('Build_TI_SimpleLink_targets'), not( eq(variables['Build.Reason'], 'PullRequest') ), or( eq(variables['Build.SourceBranchName'], 'master'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ), ne( variables['StartReleaseCandidate'], true ) )
590+
condition: and( succeeded('Build_STM32_targets'), succeeded('Build_ESP32_targets'), succeeded('Build_NXP_targets'), succeeded('Build_TI_SimpleLink_targets'), not( eq(variables['Build.Reason'], 'PullRequest') ), or( eq(variables['Build.SourceBranchName'], 'main'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ), ne( variables['StartReleaseCandidate'], true ) )
591591

592592
pool:
593593
vmImage: 'windows-2019'
@@ -616,15 +616,15 @@ jobs:
616616
gem install github_changelog_generator --quiet --no-document
617617
# need to call it passing both cache options with full path otherwise it won't work
618618
github_changelog_generator --token $(GitHubToken) --cache-log $env:AGENT_TEMPDIRECTORY\github-changelog-logger.log --cache-file $env:AGENT_TEMPDIRECTORY\github-changelog-http-cache --pr-wo-labels --future-release "v$env:NBGV_AssemblyVersion"
619-
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), or( eq(variables['Build.SourceBranchName'], 'master'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
619+
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), or( eq(variables['Build.SourceBranchName'], 'main'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
620620
displayName: Generate change log
621621
622622
# generate change log without future version
623623
- powershell: |
624624
gem install github_changelog_generator --quiet --no-document
625625
# need to call it passing both cache options with full path otherwise it won't work
626626
github_changelog_generator --token $(GitHubToken) --cache-log $env:AGENT_TEMPDIRECTORY\github-changelog-logger.log --cache-file $env:AGENT_TEMPDIRECTORY\github-changelog-http-cache --pr-wo-labels
627-
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), not( or( eq(variables['Build.SourceBranchName'], 'master'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) ) )
627+
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), not( or( eq(variables['Build.SourceBranchName'], 'main'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) ) )
628628
displayName: Generate change log
629629
630630
# push new changelog to GitHub repo
@@ -646,7 +646,7 @@ jobs:
646646
displayName: Push changelog to GitHub
647647
648648
#######################
649-
# create or update GitHub release ON tags from master branch or tags
649+
# create or update GitHub release ON tags from main branch or tags
650650
- job: Publish_Release
651651
dependsOn:
652652
- Build_STM32_targets
@@ -656,7 +656,7 @@ jobs:
656656
- Build_WIN32_nanoCLR
657657
- Generate_change_log
658658
# skip build if this is a PR, submitted by nfbot and the commit message contains [version update]
659-
condition: and( succeeded('Build_STM32_targets'), succeeded('Build_ESP32_targets'), succeeded('Build_NXP_targets'), succeeded('Build_TI_SimpleLink_targets'), succeeded('Generate_change_log'), not( eq(variables['Build.Reason'], 'PullRequest') ), or( endsWith(variables['Build.SourceBranchName'], 'master'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ), ne( variables['StartReleaseCandidate'], true ) )
659+
condition: and( succeeded('Build_STM32_targets'), succeeded('Build_ESP32_targets'), succeeded('Build_NXP_targets'), succeeded('Build_TI_SimpleLink_targets'), succeeded('Generate_change_log'), not( eq(variables['Build.Reason'], 'PullRequest') ), or( endsWith(variables['Build.SourceBranchName'], 'main'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ), ne( variables['StartReleaseCandidate'], true ) )
660660

661661
pool:
662662
vmImage: 'windows-2019'
@@ -673,15 +673,15 @@ jobs:
673673
displayName: Set build number
674674

675675
- task: GitHubReleasePublish@1
676-
condition: endsWith(variables['Build.SourceBranch'], 'master')
676+
condition: endsWith(variables['Build.SourceBranch'], 'main')
677677
displayName: Create/Update GitHub stable release
678678
inputs:
679679
githubEndpoint: 'nanoframework'
680680
githubOwner: 'nanoframework'
681681
githubRepositoryName: nf-interpreter
682682
githubTag: v$(NBGV_AssemblyVersion)
683683
githubReleaseTitle: 'nf Interpreter v$(NBGV_AssemblyVersion)'
684-
githubReleaseNotes: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).<br><br>Download images from our Bintray repo. See the available images [here](https://github.com/nanoframework/nf-interpreter/tree/master#firmware-for-reference-boards).'
684+
githubReleaseNotes: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).<br><br>Download images from our Bintray repo. See the available images [here](https://github.com/nanoframework/nf-interpreter/tree/main#firmware-for-reference-boards).'
685685
githubTargetCommitsh: $(Build.SourceVersion)
686686
githubReleaseDraft: false
687687
githubReleasePrerelease: true

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "1.6.2",
3+
"version": "1.6.4",
44
"assemblyVersion": {
55
"precision": "revision"
66
},

0 commit comments

Comments
 (0)