Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Move to nbgv (backport #2656) #2662

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions .github/workflows/azure-static-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,20 @@ jobs:
fetch-depth: 0 # Required for gitversion
submodules: true

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: build/ci/gitversion.yml

- name: Setup dotnet 8.0.301
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.301'

- uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2
id: nbgv
with:
toolVersion: 3.6.139
setAllVars: true

- run: |
cd testing/TestHarness
dotnet build -c Release /p:Build_Android=false /p:Build_iOS=false /p:Build_Windows=false /p:Build_Desktop=false "/p:Version=${{ steps.gitversion.outputs.fullSemVer }}" /p:GeneratePackageOnBuild=false /detailedsummary
dotnet build -c Release /p:Build_Android=false /p:Build_iOS=false /p:Build_Windows=false /p:Build_Desktop=false "/p:Version=${{ steps.nbgv.outputs.SemVer2 }}" /p:GeneratePackageOnBuild=false /detailedsummary
- uses: actions/upload-artifact@v3
with:
name: wasm-site
Expand Down
61 changes: 0 additions & 61 deletions build/ci/gitversion.yml

This file was deleted.

16 changes: 3 additions & 13 deletions build/ci/stage-build-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,12 @@ jobs:
- checkout: self
clean: 'true'

- task: gitversion/setup@0
retryCountOnTaskFailure: 3
inputs:
versionSpec: '5.10.3'

- task: gitversion/execute@0
retryCountOnTaskFailure: 3
inputs:
useConfigFile: true
configFilePath: build/ci/gitversion.yml
displayName: Use GitVersion

- template: templates/gitversion.yml

- bash: |
npm install -g conventional-changelog-cli
mkdir "$(build.artifactstagingdirectory)/CHANGELOG"
conventional-changelog -p angular -u -r 1 -o "$(build.artifactstagingdirectory)/CHANGELOG/CHANGELOG-$(GitVersion.SemVer).MD"
conventional-changelog -p angular -u -r 1 -o "$(build.artifactstagingdirectory)/CHANGELOG/CHANGELOG-$(NBGV_SemVer2).MD"
displayName: 'Generate CHANGELOG.MD'

- task: PublishBuildArtifacts@1
Expand Down
21 changes: 5 additions & 16 deletions build/ci/stage-build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,7 @@ jobs:

- template: templates/dotnet-install-windows.yml
- template: templates/canary-updater.yml

- task: gitversion/setup@0
retryCountOnTaskFailure: 3
inputs:
versionSpec: '5.10.3'

- task: gitversion/execute@0
retryCountOnTaskFailure: 3
inputs:
useConfigFile: true
configFilePath: build/ci/gitversion.yml
displayName: Use GitVersion
- template: templates/gitversion.yml

- powershell: |
dotnet tool update -g dotnet-vs
Expand All @@ -31,9 +20,9 @@ jobs:
echo MSBUILDPATH: $MSBUILDPATH
displayName: Setup VS17 Path

- template: templates/install-windows-sdk.yml
parameters:
sdkVersion: 19041
# - template: templates/install-windows-sdk.yml
# parameters:
# sdkVersion: 19041

- template: templates/update-vs-components.yml

Expand All @@ -44,7 +33,7 @@ jobs:
msbuildLocationMethod: location
msbuildLocation: $(MSBUILDPATH)
msbuildArchitecture: x86
msbuildArguments: /r /m /v:m /p:Configuration=Release "/p:PackageOutputPath=$(build.artifactstagingdirectory)\nuget" "/p:PackageVersion=$(GitVersion.FullSemVer)" "/p:InformationalVersion=$(GITVERSION_InformationalVersion)" /detailedsummary /bl:$(build.artifactstagingdirectory)/uno-extensions.binlog
msbuildArguments: /r /m /v:m /p:Configuration=Release "/p:PackageOutputPath=$(build.artifactstagingdirectory)\nuget" "/p:PackageVersion=$(NBGV_SemVer2)" "/p:InformationalVersion=$(NBGV_InformationalVersion)" /detailedsummary /bl:$(build.artifactstagingdirectory)/uno-extensions.binlog
clean: false
maximumCpuCount: true
restoreNugetPackages: false
Expand Down
15 changes: 2 additions & 13 deletions build/ci/stage-build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,10 @@ jobs:

- template: templates/dotnet-install.yml
- template: templates/canary-updater.yml

- task: gitversion/setup@0
retryCountOnTaskFailure: 3
inputs:
versionSpec: '5.10.3'

- task: gitversion/execute@0
retryCountOnTaskFailure: 3
inputs:
useConfigFile: true
configFilePath: build/ci/gitversion.yml
displayName: Use GitVersion
- template: templates/gitversion.yml

- script: |
dotnet build "testing/TestHarness/TestHarness.sln" /p:Build_Web=true /p:Build_Android=false /p:Build_MacCatalyst=false /p:Build_iOS=false /p:Build_Windows=false /p:Build_Desktop=false /p:Configuration=Release "/p:InformationalVersion=$(GITVERSION_InformationalVersion)" /p:GeneratePackageOnBuild=false /detailedsummary "/bl:$(build.artifactstagingdirectory)/testharness-wasm.binlog"
dotnet build "testing/TestHarness/TestHarness.sln" /p:Build_Web=true /p:Build_Android=false /p:Build_MacCatalyst=false /p:Build_iOS=false /p:Build_Windows=false /p:Build_Desktop=false /p:Configuration=Release "/p:InformationalVersion=$(NBGV_InformationalVersion)" /p:GeneratePackageOnBuild=false /detailedsummary "/bl:$(build.artifactstagingdirectory)/testharness-wasm.binlog"

- task: CopyFiles@2
displayName: 'Publish Wasm Binaries'
Expand Down
21 changes: 5 additions & 16 deletions build/ci/stage-build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,7 @@ jobs:

- template: templates/dotnet-install-windows.yml
- template: templates/canary-updater.yml

- task: gitversion/setup@0
retryCountOnTaskFailure: 3
inputs:
versionSpec: '5.10.3'

- task: gitversion/execute@0
retryCountOnTaskFailure: 3
inputs:
useConfigFile: true
configFilePath: build/ci/gitversion.yml
displayName: Use GitVersion
- template: templates/gitversion.yml

- powershell: |
dotnet tool update -g dotnet-vs
Expand All @@ -36,9 +25,9 @@ jobs:
echo MSBUILDPATH: $MSBUILDPATH
displayName: Setup VS17 Path

- template: templates/install-windows-sdk.yml
parameters:
sdkVersion: 19041
# - template: templates/install-windows-sdk.yml
# parameters:
# sdkVersion: 19041

- template: templates/update-vs-components.yml

Expand All @@ -49,7 +38,7 @@ jobs:
msbuildLocationMethod: location
msbuildLocation: $(MSBUILDPATH)
msbuildArchitecture: x86
msbuildArguments: /m /v:m /r /p:Configuration=Release "/p:InformationalVersion=$(GITVERSION_InformationalVersion)" /p:GeneratePackageOnBuild=false /p:AotAssemblies=false /p:UseWebAssemblyAOT=false /detailedsummary /bl:$(build.artifactstagingdirectory)/samples-windows-${{parameters.solutionName}}.binlog
msbuildArguments: /m /v:m /r /p:Configuration=Release "/p:InformationalVersion=$(NBGV_InformationalVersion)" /p:GeneratePackageOnBuild=false /p:AotAssemblies=false /p:UseWebAssemblyAOT=false /detailedsummary /bl:$(build.artifactstagingdirectory)/samples-windows-${{parameters.solutionName}}.binlog
clean: false
maximumCpuCount: true
restoreNugetPackages: false
Expand Down
15 changes: 15 additions & 0 deletions build/ci/templates/gitversion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
steps:
- pwsh: |
dotnet tool uninstall nbgv -g
dotnet tool install nbgv -g --version 3.6.139
nbgv cloud -a
displayName: Version with NBGV
name: NBGV

- pwsh: |
$InformationalVersion="$(NBGV_SemVer2)+$(NBGV_BuildingRef)".Replace("refs/heads/","").Replace("/","-")
echo "##vso[task.setvariable variable=NBGV_InformationalVersion;]$InformationalVersion"
echo "##vso[task.setvariable variable=NBGV_InformationalVersion;isOutput=true;]$InformationalVersion"
echo "Informational Version: $InformationalVersion"
displayName: Generate Informational Version
name: NBGV_InformationalVersion
22 changes: 22 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "5.3-dev.{height}",
"versionHeightOffset": 86,
"nuGetPackageVersion": {
"semVer": 2.0
},
"publicReleaseRefSpec": [
"^refs/heads/main$",
"^refs/heads/release/stable/\\d+(?:\\.\\d+)?$"
],
"cloudBuild": {
"setAllVariables": true,
"buildNumber": {
"enabled": true
}
},
"release": {
"branchName": "release/stable/{version}",
"firstUnstableTag": "dev"
}
}
Loading