From d9380c79fd196185bf3335de08492ba5281ffb51 Mon Sep 17 00:00:00 2001 From: Franco Fung Date: Thu, 22 Feb 2024 00:52:59 -0800 Subject: [PATCH 1/4] Initial commit for changing versioning in Wilson --- .github/workflows/dotnetcore.yml | 3 - Product.proj | 21 +++++ build/common.props | 19 ++++- build/releaseBuild.yml | 43 ++++++---- buildConfiguration.xml | 2 - buildTestPack.bat | 3 + .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 4 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 3 - updateAssemblyInfo.ps1 | 78 ------------------- updateAssemblyInfo.sh | 50 ------------ 24 files changed, 65 insertions(+), 203 deletions(-) create mode 100644 Product.proj create mode 100644 buildTestPack.bat delete mode 100644 updateAssemblyInfo.ps1 delete mode 100755 updateAssemblyInfo.sh diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index e06dad807d..bb71dcb14c 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -30,9 +30,6 @@ jobs: with: dotnet-version: 8.0.x - - name: update versions - run: .\updateAssemblyInfo.ps1 - # Build and test - name: Restore packages run: dotnet restore Wilson.sln diff --git a/Product.proj b/Product.proj new file mode 100644 index 0000000000..c208b45783 --- /dev/null +++ b/Product.proj @@ -0,0 +1,21 @@ + + + preview-$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.ToString("MMddHHmmss")) + + + + + + + + + + + + + + + + + + diff --git a/build/common.props b/build/common.props index f221545b98..de29957f4b 100644 --- a/build/common.props +++ b/build/common.props @@ -2,7 +2,6 @@ - $(MSBuildThisFileDirectory)35MSSharedLib1024.snk @@ -10,9 +9,6 @@ © Microsoft Corporation. All rights reserved. Microsoft Corporation. true - false - false - false library Microsoft IdentityModel git @@ -34,6 +30,21 @@ 12 + + + 7.3.2 + + preview-$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.ToString("MMddHHmmss")) + + preview-$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.ToString("MMddHH")) + $(WilsonVersion.Contains("-")) + $(WilsonVersion) + $(PreviewVersionSuffix) + $(WilsonCurrentVersion) + $(WilsonVersion).$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.ToString("MMdd")) + $(WilsonCurrentVersion).$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.ToString("MMdd")) + + true 7.0.0 diff --git a/build/releaseBuild.yml b/build/releaseBuild.yml index 9bb207b208..472083dd10 100644 --- a/build/releaseBuild.yml +++ b/build/releaseBuild.yml @@ -18,6 +18,10 @@ variables: - name: BuildConfiguration value: 'release' + # The following variables are set in the release build UI: + # BuildConfiguration: 'debug|release' + # WilsonVersion: ''. Full version number + jobs: - job: build pool: @@ -29,6 +33,12 @@ jobs: timeoutInMinutes: 360 steps: + - script: echo $(BuildConfiguration) + displayName: 'display Build Configuration' + + - script: echo $(WilsonVersion) + displayName: 'display WilsonVersion' + - task: UseDotNet@2 displayName: 'Use .NET Core sdk 2.x' inputs: @@ -63,19 +73,11 @@ jobs: regedit /s .\build\strongNameBypass.reg displayName: 'Strong Name Bypass' - - task: PowerShell@2 - displayName: 'Update Assembly Info' - inputs: - targetType: filePath - filePath: ./updateAssemblyInfo.ps1 - arguments: '-packageType $(BuildConfiguration)' - - task: DotNetCoreCLI@2 displayName: Build inputs: - command: 'custom' - projects: 'wilson.sln' - custom: 'msbuild' + command: 'build' + projects: 'Product.proj' arguments: '/r:True /p:Configuration=$(BuildConfiguration) /p:Platform="Any CPU" /verbosity:m /p:SourceLinkCreate=true' - task: PowerShell@2 @@ -135,12 +137,19 @@ jobs: #Sign Wilson 7x task group - template: template-sign-wilson.yaml - - task: PowerShell@2 - displayName: Pack - inputs: - targetType: filePath - filePath: ./pack.ps1 - arguments: '-buildType $(BuildConfiguration) C:\hostedtoolcache\windows\dotnet' + - task: DotNetCoreCLI@2 + displayName: 'Pack libraries' + inputs: + command: 'pack' + arguments: '--no-restore' + packDirectory: '$(Build.SourcesDirectory)\artifacts' + nobuild: true + verbosityPack: 'Minimal' + configuration: $(BuildConfiguration) + packagesToPack: 'Product.proj' + feedsToUse: 'config' + nugetConfigPath: Nuget.config + externalFeedCredentials: 'Internal Analyzers' - task: EsrpCodeSigning@4 displayName: 'Sign Nuget Packages' @@ -190,7 +199,7 @@ jobs: continueOnError: true - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'Manifest Generator ' + displayName: 'Manifest Generator' inputs: BuildDropPath: '$(Build.SourcesDirectory)\src' ManifestDirPath: '$(Build.SourcesDirectory)\artifacts' diff --git a/buildConfiguration.xml b/buildConfiguration.xml index 008234d11f..06e064dafa 100644 --- a/buildConfiguration.xml +++ b/buildConfiguration.xml @@ -2,8 +2,6 @@ x64 3.5.0-rc-1285 net461,netstandard2.0 - 7.3.2 - preview diff --git a/buildTestPack.bat b/buildTestPack.bat new file mode 100644 index 0000000000..47e4eb48c4 --- /dev/null +++ b/buildTestPack.bat @@ -0,0 +1,3 @@ +dotnet build /r Product.proj +dotnet test --no-restore --no-build Product.proj +dotnet pack --no-restore --no-build Product.proj diff --git a/src/Microsoft.IdentityModel.Abstractions/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.Abstractions/Properties/AssemblyInfo.cs index 676a61750f..9274a8764b 100644 --- a/src/Microsoft.IdentityModel.Abstractions/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.Abstractions/Properties/AssemblyInfo.cs @@ -5,9 +5,6 @@ using System.Reflection; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.JsonWebTokens/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.JsonWebTokens/Properties/AssemblyInfo.cs index 67304c933f..9ec5a0543e 100644 --- a/src/Microsoft.IdentityModel.JsonWebTokens/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.JsonWebTokens/Properties/AssemblyInfo.cs @@ -6,10 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.KeyVaultExtensions/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.KeyVaultExtensions/Properties/AssemblyInfo.cs index 67c96998c2..1f06ec3782 100644 --- a/src/Microsoft.IdentityModel.KeyVaultExtensions/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.KeyVaultExtensions/Properties/AssemblyInfo.cs @@ -5,9 +5,6 @@ using System.Reflection; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.Logging/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.Logging/Properties/AssemblyInfo.cs index f6c7fd340b..ea1a6f7754 100644 --- a/src/Microsoft.IdentityModel.Logging/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.Logging/Properties/AssemblyInfo.cs @@ -6,10 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.LoggingExtensions/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.LoggingExtensions/Properties/AssemblyInfo.cs index 67c96998c2..1f06ec3782 100644 --- a/src/Microsoft.IdentityModel.LoggingExtensions/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.LoggingExtensions/Properties/AssemblyInfo.cs @@ -5,9 +5,6 @@ using System.Reflection; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.ManagedKeyVaultSecurityKey/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.ManagedKeyVaultSecurityKey/Properties/AssemblyInfo.cs index 67c96998c2..1f06ec3782 100644 --- a/src/Microsoft.IdentityModel.ManagedKeyVaultSecurityKey/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.ManagedKeyVaultSecurityKey/Properties/AssemblyInfo.cs @@ -5,9 +5,6 @@ using System.Reflection; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.Protocols.OpenIdConnect/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.Protocols.OpenIdConnect/Properties/AssemblyInfo.cs index 676a61750f..9274a8764b 100644 --- a/src/Microsoft.IdentityModel.Protocols.OpenIdConnect/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.Protocols.OpenIdConnect/Properties/AssemblyInfo.cs @@ -5,9 +5,6 @@ using System.Reflection; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.Protocols.SignedHttpRequest/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.Protocols.SignedHttpRequest/Properties/AssemblyInfo.cs index 7239f59c93..3b8129771a 100644 --- a/src/Microsoft.IdentityModel.Protocols.SignedHttpRequest/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.Protocols.SignedHttpRequest/Properties/AssemblyInfo.cs @@ -6,10 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.Protocols.WsFederation/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.Protocols.WsFederation/Properties/AssemblyInfo.cs index 8daf39a93c..c9b548567a 100644 --- a/src/Microsoft.IdentityModel.Protocols.WsFederation/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.Protocols.WsFederation/Properties/AssemblyInfo.cs @@ -6,10 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.Protocols/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.Protocols/Properties/AssemblyInfo.cs index f0ea1c0c0a..be5b7fa409 100644 --- a/src/Microsoft.IdentityModel.Protocols/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.Protocols/Properties/AssemblyInfo.cs @@ -6,10 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.TestExtensions/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.TestExtensions/Properties/AssemblyInfo.cs index 67c96998c2..1f06ec3782 100644 --- a/src/Microsoft.IdentityModel.TestExtensions/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.TestExtensions/Properties/AssemblyInfo.cs @@ -5,9 +5,6 @@ using System.Reflection; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.Tokens.Saml/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.Tokens.Saml/Properties/AssemblyInfo.cs index c9e467a305..fc5e168021 100644 --- a/src/Microsoft.IdentityModel.Tokens.Saml/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.Tokens.Saml/Properties/AssemblyInfo.cs @@ -6,11 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.Tokens/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.Tokens/Properties/AssemblyInfo.cs index f27198cc90..f22a0f4b5e 100644 --- a/src/Microsoft.IdentityModel.Tokens/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.Tokens/Properties/AssemblyInfo.cs @@ -6,10 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.Validators/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.Validators/Properties/AssemblyInfo.cs index a7c437bab0..3f63a1935f 100644 --- a/src/Microsoft.IdentityModel.Validators/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.Validators/Properties/AssemblyInfo.cs @@ -6,10 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/Microsoft.IdentityModel.Xml/Properties/AssemblyInfo.cs b/src/Microsoft.IdentityModel.Xml/Properties/AssemblyInfo.cs index 9b85d9181e..ad3d6cce6c 100644 --- a/src/Microsoft.IdentityModel.Xml/Properties/AssemblyInfo.cs +++ b/src/Microsoft.IdentityModel.Xml/Properties/AssemblyInfo.cs @@ -6,10 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/src/System.IdentityModel.Tokens.Jwt/Properties/AssemblyInfo.cs b/src/System.IdentityModel.Tokens.Jwt/Properties/AssemblyInfo.cs index ce228f8cf8..6454a8c03b 100644 --- a/src/System.IdentityModel.Tokens.Jwt/Properties/AssemblyInfo.cs +++ b/src/System.IdentityModel.Tokens.Jwt/Properties/AssemblyInfo.cs @@ -6,10 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyInformationalVersion("0.0.1")] -[assembly: AssemblyFileVersion("0.0.1")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyVersion("0.0.1")] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] diff --git a/updateAssemblyInfo.ps1 b/updateAssemblyInfo.ps1 deleted file mode 100644 index ca94af04ea..0000000000 --- a/updateAssemblyInfo.ps1 +++ /dev/null @@ -1,78 +0,0 @@ -param([string]$root=$PSScriptRoot, - [string]$packageType="preview") - -################################################# Functions ############################################################ - -function WriteSectionHeader($sectionName) -{ - $startTime = Get-Date -DisplayHint Time - Write-Host "" - Write-Host "============================" - Write-Host $sectionName - Write-Host "Start Time: " $startTime - Write-Host "" -} - -function WriteSectionFooter($sectionName) -{ - $startTime = Get-Date -DisplayHint Time - Write-Host "" - Write-Host $sectionName - Write-Host "End Time: " $startTime - Write-Host "============================" - Write-Host "" -} - -################################################# Functions ############################################################ - -WriteSectionHeader("updateAssemblyInfo.ps1"); -Write-Host "root: " $root; -Write-Host "PSScriptRoot: " $PSScriptRoot; - -$date = Get-Date -$dateTimeStamp = ($date.ToString("yy")-19).ToString() + $date.ToString("MMddHHmmss") -[xml]$buildConfiguration = Get-Content $PSScriptRoot\buildConfiguration.xml - -$assemblyVersion = [string]$buildConfiguration.SelectSingleNode("root/assemblyVersion").InnerText -$assemblyFileVersion = $assemblyVersion + "." + ($date.ToString("yy")-19).ToString() + $date.ToString("MMdd") -$assemblyInformationalVersion = $assemblyVersion + "." + $dateTimeStamp + "." + (git rev-parse HEAD) -Write-Host "assemblyVersion: " $assemblyVersion -Write-Host "assemblyFileVersion: " $assemblyFileVersion -Write-Host "assemblyInformationalVersion: " $assemblyInformationalVersion - -$nugetSuffix = [string]$buildConfiguration.SelectSingleNode("root/nugetSuffix").InnerText -if ( $packageType -eq "release") -{ - $versionSuffix = "" -} -else -{ - $versionSuffix = $nugetSuffix + "-" + $dateTimeStamp -} - -Write-Host "nugetSuffix: " $nugetSuffix -Write-Host "versionSuffix: " $versionSuffix - -$versionPath = $PSScriptRoot + "/build/version.props" -$version = Get-Content $versionPath -$version = $version -replace "(.*)", "$assemblyVersion" -$version = $version -replace "(.*)", "$versionSuffix" -Set-Content $versionPath $version - -foreach($project in $buildConfiguration.SelectNodes("root/projects/src/project")) -{ - $name = $project.name - $assemblyInfoPath = "$root\src\$name\Properties\AssemblyInfo.cs" - Write-Host "assemblyInfoPath: " $assemblyInfoPath - - $assemblyInfo = Get-Content $assemblyInfoPath - $assemblyInfo = $assemblyInfo -replace "AssemblyVersion(.*)", "AssemblyVersion(""$assemblyVersion"")]" - $assemblyInfo = $assemblyInfo -replace "AssemblyFileVersion(.*)", "AssemblyFileVersion(""$assemblyFileVersion"")]" - $assemblyInfo = $assemblyInfo -replace "AssemblyInformationalVersion(.*)", "AssemblyInformationalVersion(""$assemblyInformationalVersion"")]" - Set-Content $assemblyInfoPath $assemblyInfo -} - -WriteSectionFooter("updateAssemblyInfo.ps1") - -# Needed for testing build quality -return "$assemblyVersion-$versionSuffix" diff --git a/updateAssemblyInfo.sh b/updateAssemblyInfo.sh deleted file mode 100755 index 7308e08c6f..0000000000 --- a/updateAssemblyInfo.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -set -euo pipefail - -scriptroot=$(cd -P "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) - -packageType=${1:-preview} - -date=$(date '+%y%m%d%H%M%S') -# Formats the date by replacing the 4-digit year with a 2-digit value and then subtract 19 -dateTimeStamp=$(echo $((10#${date:0:2}-19)))${date:2} - -commitSha=$(git rev-parse HEAD) - -assemblyVersion=$(sed -n 's/.*\([^<]*\)<.*/\1/p' ${scriptroot}/buildConfiguration.xml) -assemblyFileVersion="$assemblyVersion.${dateTimeStamp::$((${#dateTimeStamp} - 6))}" # Trim minutes/seconds -assemblyInformationalVersion="$assemblyVersion.$dateTimeStamp.$commitSha" - -echo "assemblyVersion: $assemblyVersion" -echo "assemblyFileVersion: $assemblyFileVersion" -echo "assemblyInformationalVersion: $assemblyInformationalVersion" - -nugetSuffix=$(sed -n 's/.*\([^<]*\)<.*/\1/p' ${scriptroot}/buildConfiguration.xml) -if [ "$packageType" = "release" ] -then - versionSuffix="" -else - versionSuffix="$nugetSuffix-$dateTimeStamp" -fi - -echo "nugetSuffix: $nugetSuffix" - -versionPath="${scriptroot}/build/version.props" -version=$(cat $versionPath) -version=$(echo "$version" | sed "s|.*|$assemblyVersion|") -version=$(echo "$version" | sed "s|.*|$versionSuffix|") -echo "$version" > $versionPath - -projects=$(sed -n '//,/<\/src>/p' ${scriptroot}/buildConfiguration.xml | sed -n 's/.*name="\([^"]*\)".*/\1/p') - -for project in $projects; do - name="$project" - assemblyInfoPath="${scriptroot}/src/$name/Properties/AssemblyInfo.cs" - echo "assemblyInfoPath: $assemblyInfoPath" - - assemblyInfo=$(cat $assemblyInfoPath) - assemblyInfo=$(echo "$assemblyInfo" | sed "s|AssemblyVersion.*|AssemblyVersion(\"$assemblyVersion\")]|") - assemblyInfo=$(echo "$assemblyInfo" | sed "s|AssemblyFileVersion.*|AssemblyFileVersion(\"$assemblyFileVersion\")]|") - assemblyInfo=$(echo "$assemblyInfo" | sed "s|AssemblyInformationalVersion.*|AssemblyInformationalVersion(\"$assemblyInformationalVersion\")]|") - echo "$assemblyInfo" > $assemblyInfoPath -done From 82ceea6ecf4817b6f05c84b4baf95dc2838efc96 Mon Sep 17 00:00:00 2001 From: Franco Fung Date: Thu, 22 Feb 2024 10:08:11 -0800 Subject: [PATCH 2/4] Fix pack error --- build/releaseBuild.yml | 2 -- .../Microsoft.IdentityModel.AotCompatibility.TestApp.csproj | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build/releaseBuild.yml b/build/releaseBuild.yml index 472083dd10..f1d1c25860 100644 --- a/build/releaseBuild.yml +++ b/build/releaseBuild.yml @@ -15,8 +15,6 @@ variables: - group: Middleware - name: BuildPlatform value: 'any cpu' - - name: BuildConfiguration - value: 'release' # The following variables are set in the release build UI: # BuildConfiguration: 'debug|release' diff --git a/test/Microsoft.IdentityModel.AotCompatibility.TestApp/Microsoft.IdentityModel.AotCompatibility.TestApp.csproj b/test/Microsoft.IdentityModel.AotCompatibility.TestApp/Microsoft.IdentityModel.AotCompatibility.TestApp.csproj index b8b047c289..6683368f79 100644 --- a/test/Microsoft.IdentityModel.AotCompatibility.TestApp/Microsoft.IdentityModel.AotCompatibility.TestApp.csproj +++ b/test/Microsoft.IdentityModel.AotCompatibility.TestApp/Microsoft.IdentityModel.AotCompatibility.TestApp.csproj @@ -5,7 +5,7 @@ Exe true full - true + false From f91418bd7b5ffd62e57e704b707a42e4e6a592da Mon Sep 17 00:00:00 2001 From: Franco Fung Date: Fri, 23 Feb 2024 10:18:23 -0800 Subject: [PATCH 3/4] Removed unenessary steps from dotnet.yml --- .github/workflows/dotnetcore.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index bb71dcb14c..75a8239479 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -30,13 +30,9 @@ jobs: with: dotnet-version: 8.0.x - # Build and test - - name: Restore packages - run: dotnet restore Wilson.sln - - name: Run the tests run: dotnet test Wilson.sln # Run baseline package validation - name: Pack - run: .\pack.ps1 + run: dotnet pack --no-restore --no-build From e0c8ffeadacb9bd9c39d564f7941a07f3e72d72d Mon Sep 17 00:00:00 2001 From: Franco Fung Date: Fri, 23 Feb 2024 10:30:36 -0800 Subject: [PATCH 4/4] Added Product.Proj as target for pack --- .github/workflows/dotnetcore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 75a8239479..57505950d5 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -35,4 +35,4 @@ jobs: # Run baseline package validation - name: Pack - run: dotnet pack --no-restore --no-build + run: dotnet pack Product.proj --no-restore --no-build