forked from IronLanguages/ironpython3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
steps.yml
146 lines (125 loc) · 4.74 KB
/
steps.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
parameters:
os: ''
steps:
- checkout: self
submodules: true
- powershell: |
$xml = [xml] (Get-Content CurrentVersion.props)
$major = $xml.Project.PropertyGroup.MajorVersion
$minor = $xml.Project.PropertyGroup.MinorVersion
$micro = $xml.Project.PropertyGroup.MicroVersion
$serial = $xml.Project.PropertyGroup.ReleaseSerial
$level = $xml.Project.PropertyGroup.ReleaseLevel
if($level -eq 'final') {
$PackageVersion = "$major.$minor.$micro"
} elseif($level -ne 'final' -or $serial -ne '0') {
$PackageVersion = "$major.$minor.$micro-$level$serial"
}
# store the package version to an environment variable
Write-Host ("##vso[task.setvariable variable=PackageVersion;isSecret=false;isOutput=true;]$PackageVersion")
displayName: Grab Package Version
- task: UseDotNet@2
displayName: Install .NET Core 3.1 runtime for testing
inputs:
packageType: 'runtime'
version: '3.1.x'
- task: UseDotNet@2
displayName: Install .NET 6.0 runtime for testing
inputs:
packageType: 'runtime'
version: '6.0.x'
- task: UseDotNet@2
displayName: Install .NET 8.0 SDK for build
inputs:
packageType: 'sdk'
version: '8.0.x'
# Set Mono version on macOS
- ${{ if eq(parameters.os, 'macOS') }}:
- task: Bash@3
displayName: Set Mono Version
inputs:
targetType: inline
script: |
# use Mono 6.4.0 version
SYMLINK=6.4.0
MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$SYMLINK
echo "##vso[task.setvariable variable=DYLD_FALLBACK_LIBRARY_PATH;]$MONOPREFIX/lib:/lib:/usr/lib:$DYLD_LIBRARY_FALLBACK_PATH"
echo "##vso[task.setvariable variable=PKG_CONFIG_PATH;]$MONOPREFIX/lib/pkgconfig:$MONOPREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
echo "##vso[task.setvariable variable=PATH;]$MONOPREFIX/bin:$PATH"
# Install mono when running on Linux
- ${{ if eq(parameters.os, 'Linux') }}:
- task: Bash@3
displayName: Install tools
inputs:
targetType: inline
script: |
sudo apt-get -yq install mono-vbnc dos2unix
# Dump version info
- task: PowerShell@2
displayName: Version Information
inputs:
targetType: inline
script: |
dotnet --info
try { msbuild -version } catch { }
try { mono --version } catch { }
- powershell: ./make.ps1
displayName: Build
- powershell: ./make.ps1 test-all
displayName: Test
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
mergeTestResults: true
testRunTitle: ${{ parameters.os }}
condition: succeededOrFailed()
- powershell: ./make.ps1 package
displayName: Package
condition: succeededOrFailed()
- task: CopyFiles@2
displayName: Copy NuGet and Zip Packages
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/Package/Release/Packages'
Contents: |
**/*.nupkg
**/*.snupkg
**/*.zip
TargetFolder: '$(Build.ArtifactStagingDirectory)'
condition: and(succeededOrFailed(), eq(variables['system.pullrequest.isfork'], false))
- ${{ if eq(parameters.os, 'Windows') }}:
- task: CopyFiles@2
displayName: Copy MSI Installer
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/Package/Release/Packages'
Contents: '**/*.msi'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
condition: and(succeededOrFailed(), eq(variables['system.pullrequest.isfork'], false))
- ${{ if eq(parameters.os, 'Linux') }}:
- task: CopyFiles@2
displayName: Copy Deb Installer
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/Package/Release/Packages'
Contents: '**/*.deb'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
condition: and(succeededOrFailed(), eq(variables['system.pullrequest.isfork'], false))
- ${{ if eq(parameters.os, 'macOS') }}:
- task: CopyFiles@2
displayName: Copy Pkg Installer
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/Package/Release/Packages'
Contents: '**/*.pkg'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
condition: and(succeededOrFailed(), eq(variables['system.pullrequest.isfork'], false))
- task: CopyFiles@2
displayName: Copy Build Logs
inputs:
Contents: '*.binlog'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
condition: and(succeededOrFailed(), eq(variables['system.pullrequest.isfork'], false))
- task: PublishBuildArtifacts@1
displayName: Publish Artifacts
inputs:
ArtifactName: ${{ format('{0} Artifacts', parameters.os) }}
condition: and(succeededOrFailed(), eq(variables['system.pullrequest.isfork'], false))