Skip to content

Commit 1b59d12

Browse files
committed
ci: Move to nbgv
1 parent 4e6fe2a commit 1b59d12

File tree

7 files changed

+52
-98
lines changed

7 files changed

+52
-98
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,13 @@ jobs:
2828
with:
2929
fetch-depth: 0 # Required for gitversion
3030
submodules: true
31-
32-
- name: Install GitVersion
33-
uses: gittools/actions/gitversion/[email protected]
34-
with:
35-
versionSpec: '5.x'
36-
37-
- name: Determine Version
38-
id: gitversion
39-
uses: gittools/actions/gitversion/[email protected]
31+
32+
- uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2
33+
id: nbgv
4034
with:
41-
useConfigFile: true
42-
configFilePath: gitversion.yml
43-
35+
toolVersion: 3.6.139
36+
setAllVars: true
37+
4438
# Daily builds .NET
4539
- run: |
4640
wget https://dot.net/v1/dotnet-install.sh
@@ -49,7 +43,6 @@ jobs:
4943
echo ~/.dotnet >> $GITHUB_PATH
5044
5145
name: Setup .NET
52-
5346
5447
# - name: Setup .NET
5548
# uses: actions/[email protected]

build/ci/gitversion.yml

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
steps:
2-
- task: UseDotNet@2
3-
displayName: 'Use .NET'
4-
inputs:
5-
packageType: runtime
6-
version: 5.0.3
2+
- pwsh: |
3+
dotnet tool uninstall nbgv -g
4+
dotnet tool install nbgv -g --version 3.6.139
5+
nbgv cloud -a
6+
displayName: Version with NBGV
7+
name: NBGV
78

8-
- task: UseDotNet@2
9-
displayName: 'Use .NET'
10-
inputs:
11-
packageType: runtime
12-
version: 6.0.0
9+
- pwsh: |
10+
$InformationalVersion="$(NBGV_SemVer2)+$(NBGV_GitCommitId)-$(NBGV_BuildingRef)".Replace("refs/heads/","").Replace("/","-")
11+
echo "##vso[task.setvariable variable=NBGV_InformationalVersion;]$InformationalVersion"
12+
echo "##vso[task.setvariable variable=NBGV_InformationalVersion;isOutput=true;]$InformationalVersion"
13+
echo "Informational Version: $InformationalVersion"
1314
14-
- task: gitversion/setup@0
15-
inputs:
16-
versionSpec: '5.10.3'
17-
18-
- task: gitversion/execute@0
19-
inputs:
20-
updateAssemblyInfo: 'False'
21-
useConfigFile: true
22-
configFilePath: $(build.sourcesdirectory)/gitversion.yml
23-
24-
displayName: Run GitVersion
15+
displayName: Generate Informational Version
16+
name: NBGV_InformationalVersion

build/ci/stage-build-packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
3636
- script: |
3737
cd $(build.sourcesdirectory)\src
38-
dotnet msbuild Uno.Wasm.Bootstrap-packages-only.slnf /r /p:Configuration=Release /p:InformationalVersion=$(GITVERSION.INFORMATIONALVERSION) /p:PackageReleaseNotesFile=$(Build.SourcesDirectory)/build/CHANGELOG.md /p:PackageVersion=$(GITVERSION.FullSemVer) /p:PackageOutputPath=$(build.sourcesdirectory)\build\nuget /bl:$(build.artifactstagingdirectory)/win-packages.binlog
38+
dotnet msbuild Uno.Wasm.Bootstrap-packages-only.slnf /r /p:Configuration=Release /p:InformationalVersion=$(NBGV_InformationalVersion) /p:PackageReleaseNotesFile=$(Build.SourcesDirectory)/build/CHANGELOG.md /p:PackageVersion=$(NBGV_SemVer2) /p:PackageOutputPath=$(build.sourcesdirectory)\build\nuget /bl:$(build.artifactstagingdirectory)/win-packages.binlog
3939
displayName: Build packages
4040
4141
- script: |
@@ -71,7 +71,7 @@ jobs:
7171
ArtifactType: Container
7272

7373
- script: |
74-
dotnet msbuild /r /bl /m:1 /p:Configuration=Release /p:DISABLE_CLIHOST_NET6=true /p:InformationalVersion=$(GITVERSION.INFORMATIONALVERSION) /p:PackageVersion=$(GITVERSION.FullSemVer) /p:PackageOutputPath=$(build.sourcesdirectory)\build\nuget $(build.sourcesdirectory)/src/Uno.Wasm.Bootstrap-msbuild-only.slnf /bl:$(build.artifactstagingdirectory)/win-validation-binaries.binlog
74+
dotnet msbuild /r /bl /m:1 /p:Configuration=Release /p:DISABLE_CLIHOST_NET6=true /p:InformationalVersion=$(NBGV_InformationalVersion) /p:PackageVersion=$(NBGV_SemVer2) /p:PackageOutputPath=$(build.sourcesdirectory)\build\nuget $(build.sourcesdirectory)/src/Uno.Wasm.Bootstrap-msbuild-only.slnf /bl:$(build.artifactstagingdirectory)/win-validation-binaries.binlog
7575
7676
displayName: Build Validation Binaries
7777

doc/release-procedure.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
# Uno.Wasm.Bootstrap release procedure
22

3-
Uno.Wasm.Bootstrap uses [GitVersion](https://gitversion.readthedocs.io/en/latest/) for its versioning, in `mainline` mode for the `release/stable` branches, and **ContinuousDeployment** for the `master` branch.
3+
Uno.Wasm.Bootstrap uses [NBGV](https://github.com/dotnet/nbgv) for its versioning.
44

55
Tagging is the main driver for planning releases.
66

77
## Branches
88

9-
- On the `master` branch, the main development is happening and is considered unstable. The nuget packages produced end with `-dev.X`, where X is the number of commits since the last initiated release.
10-
- On the `release/beta` branch, stabilization occurs to get a stable release. The version is inherited from the branch point from master. The nuget packages produced end with `-beta.X`, where X is the number of commits since the last stable release.
9+
- On the `main` branch, the main development is happening and is considered unstable. The nuget packages produced end with `-dev.X`, where X is the number of commits since the last initiated release.
10+
- On the `release/beta` branch, stabilization occurs to get a stable release. The version is inherited from the branch point from main. The nuget packages produced end with `-beta.X`, where X is the number of commits since the last stable release.
1111
- On the `release/stable` branch, stable nuget packages are produced for each pushed merge or commit. The **Patch** number is increased by the number of commits since the release tagging occurred.
1212
- On `dev`, `feature`, and `project` branches, the behavior is to inherit from the base branch it was created from and create a nuget package with an experimental tag. Those branches must not be tagged.
1313

1414
## Creating a release
1515

1616
### When planning for a beta
1717

18-
- Once a release is planned, make a branch in `release/beta` (e.g. `release/beta/1.29`), and tag the commit using the requested version (e.g. `1.29`). Do not include the patch number, as it will be added by GitHub when publishing a release. Tagging will automatically increased the version in the `master` branch by a **minor** number.
18+
- Once a release is planned, make a branch in `release/beta` (e.g. `release/beta/1.29`), and tag the commit using the requested version (e.g. `1.29`). Do not include the patch number, as it will be added by GitHub when publishing a release. Tagging will automatically increased the version in the `main` branch by a **minor** number.
1919
- Make stabilization fixes to the `release/beta/1.29` branch.
2020
- Once the stabilization fixes are done, take the last `release/beta/1.29` commit and make a `release/stable/1.29` branch. Commits to this branch will automatically keep the `1.29` version, as the base **beta branch** was tagged `1.29`.
2121
- Publish the release on GitHub using the patch number (e.g. `1.29.0` if there where no changes)
2222

2323
### When planning for a release without a beta
2424

25-
- Once a release is planned, make a branch in `release/stable` (e.g. `release/stable/1.29`), and tag the commit using the requested version (e.g. `1.29`). Tagging will automatically the version in the `master` increased by a **minor** number.
25+
- Once a release is planned, make a branch in `release/stable` (e.g. `release/stable/1.29`), and tag the commit using the requested version (e.g. `1.29`). Tagging will automatically the version in the `main` increased by a **minor** number.
2626
- Commits to `release/stable/1.29` will automatically keep the `1.29` version.
2727
- Publish the release on GitHub using the patch number (e.g. `1.29.0` if there where no changes)

gitversion.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/Uno.Wasm.Bootstrap/Uno.Wasm.Bootstrap.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<IsPublishable>false</IsPublishable>
1616
</PropertyGroup>
1717

18-
<PropertyGroup Condition="'$(GitVersion_Sha)'!=''">
19-
<AssemblyName>Uno.Wasm.Bootstrap.v$(GitVersion_Sha)</AssemblyName>
20-
<RootNamespace>Uno.Wasm.Bootstrap.v$(GitVersion_Sha)</RootNamespace>
18+
<PropertyGroup Condition="'$(NBGV_GitCommitId)'!=''">
19+
<AssemblyName>Uno.Wasm.Bootstrap.v$(NBGV_GitCommitId)</AssemblyName>
20+
<RootNamespace>Uno.Wasm.Bootstrap.v$(NBGV_GitCommitId)</RootNamespace>
2121
</PropertyGroup>
2222

2323
<PropertyGroup>
@@ -173,10 +173,10 @@
173173
</ItemGroup>
174174
</Target>
175175

176-
<Target Name="UpdateTasksSHA" Condition="'$(GitVersion_Sha)'!=''" BeforeTargets="CoreCompile">
176+
<Target Name="UpdateTasksSHA" Condition="'$(NBGV_GitCommitId)'!=''" BeforeTargets="CoreCompile">
177177

178178
<PropertyGroup>
179-
<_CurrentVersion>v$(GitVersion_Sha)</_CurrentVersion>
179+
<_CurrentVersion>v$(NBGV_GitCommitId)</_CurrentVersion>
180180
</PropertyGroup>
181181

182182
<ItemGroup>

version.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
3+
"version": "10.0-dev.{height}",
4+
"nuGetPackageVersion": {
5+
"semVer": 2.0
6+
},
7+
"publicReleaseRefSpec": [
8+
"^refs/heads/main$",
9+
"^refs/heads/release/stable/\\d+(?:\\.\\d+)?$"
10+
],
11+
"cloudBuild": {
12+
"setAllVariables": true,
13+
"buildNumber": {
14+
"enabled": true
15+
}
16+
},
17+
"release": {
18+
"branchName": "release/stable/{version}",
19+
"firstUnstableTag": "dev"
20+
}
21+
}

0 commit comments

Comments
 (0)