mirror of https://github.com/icsharpcode/ILSpy.git
3 changed files with 128 additions and 2 deletions
@ -0,0 +1,40 @@ |
|||||||
|
$ErrorActionPreference = "Stop" |
||||||
|
|
||||||
|
$baseCommit = "d779383cb85003d6dabeb976f0845631e07bf463"; |
||||||
|
$baseCommitRev = 1; |
||||||
|
|
||||||
|
# make sure this list matches artifacts-only branches list in azure-pipelines.yml! |
||||||
|
$masterBranches = @("master", "3.2.x"); |
||||||
|
|
||||||
|
$globalAssemblyInfoTemplateFile = "ILSpy/Properties/AssemblyInfo.template.cs"; |
||||||
|
|
||||||
|
$versionParts = @{}; |
||||||
|
Get-Content $globalAssemblyInfoTemplateFile | where { $_ -match 'string (\w+) = "?(\w+)"?;' } | foreach { $versionParts.Add($Matches[1], $Matches[2]) } |
||||||
|
|
||||||
|
$major = $versionParts.Major; |
||||||
|
$minor = $versionParts.Minor; |
||||||
|
$build = $versionParts.Build; |
||||||
|
$versionName = $versionParts.VersionName; |
||||||
|
|
||||||
|
if ($versionName -ne "null") { |
||||||
|
$versionName = "-$versionName"; |
||||||
|
} else { |
||||||
|
$versionName = ""; |
||||||
|
} |
||||||
|
if ($masterBranches -contains $env:BUILD_SOURCEBRANCHNAME) { |
||||||
|
$branch = ""; |
||||||
|
} else { |
||||||
|
$branch = "-$env:BUILD_SOURCEBRANCHNAME"; |
||||||
|
} |
||||||
|
if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) { |
||||||
|
$suffix = "-pr$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"; |
||||||
|
} else { |
||||||
|
$suffix = ""; |
||||||
|
} |
||||||
|
|
||||||
|
$revision = [Int32]::Parse((git rev-list --count "$baseCommit..HEAD")) + $baseCommitRev; |
||||||
|
|
||||||
|
$newVersion="$major.$minor.$build.$revision"; |
||||||
|
$env:ILSPY_VERSION_NUMBER="$newVersion$branch$versionName$suffix"; |
||||||
|
Write-Host "##vso[build.updatebuildnumber]$newVersion$branch$versionName$suffix"; |
||||||
|
Write-Host "new version: $newVersion$branch$versionName$suffix"; |
@ -0,0 +1,86 @@ |
|||||||
|
trigger: |
||||||
|
- master |
||||||
|
- msix |
||||||
|
- 3.2.x |
||||||
|
|
||||||
|
pr: |
||||||
|
- master |
||||||
|
- 3.2.x |
||||||
|
|
||||||
|
variables: |
||||||
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true |
||||||
|
BuildPlatform: Any CPU |
||||||
|
|
||||||
|
jobs: |
||||||
|
- job: Build |
||||||
|
pool: |
||||||
|
vmImage: windows-2019 |
||||||
|
strategy: |
||||||
|
matrix: |
||||||
|
Config_Release: |
||||||
|
BuildConfiguration: Release |
||||||
|
Config_Debug: |
||||||
|
BuildConfiguration: Debug |
||||||
|
|
||||||
|
steps: |
||||||
|
- checkout: self |
||||||
|
submodules: recursive |
||||||
|
|
||||||
|
- task: DotNetCoreInstaller@0 |
||||||
|
inputs: |
||||||
|
version: '3.0.100-preview5-011568' |
||||||
|
|
||||||
|
- powershell: .\BuildTools\pipelines-install.ps1 |
||||||
|
displayName: Install |
||||||
|
|
||||||
|
- task: MSBuild@1 |
||||||
|
displayName: Restore ILSpy |
||||||
|
inputs: |
||||||
|
solution: ILSpy.sln |
||||||
|
msbuildArguments: /t:restore |
||||||
|
configuration: $(BuildConfiguration) |
||||||
|
platform: $(BuildPlatform) |
||||||
|
|
||||||
|
- task: MSBuild@1 |
||||||
|
displayName: Build ILSpy |
||||||
|
inputs: |
||||||
|
solution: ILSpy.sln |
||||||
|
msbuildArguments: /restore |
||||||
|
configuration: $(BuildConfiguration) |
||||||
|
platform: $(BuildPlatform) |
||||||
|
maximumCpuCount: true |
||||||
|
|
||||||
|
- task: VSTest@2 |
||||||
|
displayName: Test |
||||||
|
inputs: |
||||||
|
testSelector: testAssemblies |
||||||
|
testAssemblyVer2: | |
||||||
|
ICSharpCode.Decompiler.Tests\bin\$(BuildConfiguration)\net462\ICSharpCode.Decompiler.Tests.exe |
||||||
|
ILSpy.Tests\bin\$(BuildConfiguration)\net462\ILSpy.Tests.exe |
||||||
|
ILSpy.BamlDecompiler.Tests\bin\$(BuildConfiguration)\net462\ILSpy.BamlDecompiler.Tests.dll |
||||||
|
|
||||||
|
- task: ArchiveFiles@1 |
||||||
|
displayName: Create zip |
||||||
|
inputs: |
||||||
|
archiveType: zip |
||||||
|
rootFolder: ILSpy/bin/$(BuildConfiguration)/net462 |
||||||
|
archiveFile: $(Build.ArtifactStagingDirectory)\$(BuildConfiguration)\ILSpy.$(Build.BuildNumber).zip |
||||||
|
includeRootFolder: false |
||||||
|
|
||||||
|
- script: python BuildTools\tidy.py |
||||||
|
displayName: Tab check |
||||||
|
|
||||||
|
- task: CopyFiles@2 |
||||||
|
displayName: Move VSIX to publish directory |
||||||
|
inputs: |
||||||
|
contents: | |
||||||
|
'**/*.vsix' |
||||||
|
'**/*.nupkg' |
||||||
|
targetFolder: $(Build.ArtifactStagingDirectory)\$(BuildConfiguration) |
||||||
|
flattenFolders: true |
||||||
|
|
||||||
|
- task: PublishPipelineArtifact@0 |
||||||
|
displayName: Publish $(BuildConfiguration) |
||||||
|
inputs: |
||||||
|
targetPath: $(Build.ArtifactStagingDirectory)\$(BuildConfiguration) |
||||||
|
artifactName: Binaries - $(BuildConfiguration) |
Loading…
Reference in new issue