-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
159 lines (150 loc) · 4.75 KB
/
azure-pipelines.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
147
148
149
150
151
152
153
154
155
156
157
158
159
parameters:
- name: sqliteYear
displayName: Year of sqlite build
type: number
default: 2023
- name: sqliteVersion
displayName: Sqlite version number
type: number
default: 3420000
- name: systemDataSqliteVersion
displayName: System.Data.Sqlite version number
type: string
default: 1.0.118.0
variables:
minorVersion: $[counter('minorVersion', 1)]
trigger:
branches:
include:
- master
pr:
branches:
include:
- master
stages:
- stage: Setup
displayName: Setup
jobs:
- job:
displayName: Build Variables
pool:
vmImage: 'ubuntu-22.04'
steps:
# Set the build name properly. The 'name' property won't recursively expand so hack here:
- bash: |
NUGETVERSION="${{ parameters.systemDataSqliteVersion}}-$MINORVERSION"
echo "##vso[build.updatebuildnumber]$NUGETVERSION"
displayName: Set Build Name
- stage: Build
dependsOn: []
jobs:
- job: SQLite
strategy:
matrix:
linux-x64:
osName: 'linux'
imageName: 'ubuntu-22.04'
osx-x64:
osName: 'osx-x64'
imageName: 'macos-12'
osx-arm64:
osName: 'osx-arm64'
imageName: 'macos-12'
win-x64:
osName: 'win-x64'
imageName: 'windows-2022'
win-x86:
osName: 'win-x86'
imageName: 'windows-2022'
pool:
vmImage: $(imageName)
steps:
- checkout: self
- bash: ./build_$(osName).sh
env:
YEAR: ${{ parameters.sqliteYear }}
VERSION: ${{ parameters.sqliteVersion }}
displayName: Build
- publish: src
artifact: '$(osName)_native'
- job: SystemDataSQLite
pool:
vmImage: 'windows-2022'
steps:
- bash: ./get_system_data_sqlite.sh ${{ parameters.systemDataSqliteVersion }}
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: 'net/SQLite.NET.2015.MSBuild.sln'
- task: MSBuild@1
displayName: .NET 4.6.1
inputs:
solution: 'net/SQLite.NET.2015.MSBuild.sln'
configuration: 'ReleaseManagedOnly'
msbuildArguments: '/t:System_Data_SQLite_2015 /p:UseInteropDll=false /p:UseSqliteStandard=true'
- task: DotNetCoreCLI@2
displayName: .NET Standard 2.0
inputs:
command: 'build'
projects: 'net/SQLite.NET.NetStandard20.MSBuild.sln'
arguments: '/p:Configuration=ReleaseManagedOnly /p:UseInteropDll=false /p:UseSqliteStandard=true'
- publish: net/bin
artifact: 'System.Data.SQLite'
- stage: Package
dependsOn: Build
jobs:
- job: Nuget
pool:
vmImage: 'windows-2022'
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: win-x64_native
targetPath: artifact/win-x64
itemPattern: 'sqlite3.dll'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: win-x86_native
targetPath: artifact/win-x86
itemPattern: 'sqlite3.dll'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: osx-x64_native
targetPath: artifact/osx-x64
itemPattern: 'libsqlite3.dylib'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: osx-arm64_native
targetPath: artifact/osx-arm64
itemPattern: 'libsqlite3.dylib'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: System.Data.SQLite
targetPath: net/bin
- bash: |
NUGETVERSION="${{ parameters.systemDataSqliteVersion}}-$MINORVERSION"
echo $NUGETVERSION
sed -i'' -e "s/<version>[0-9.*-]\+<\/version>/<version>${NUGETVERSION}<\/version>/g" SQLite.Core.nuspec
- task: NuGetToolInstaller@0
- bash: |
ls -lR
- task: NuGetCommand@2
inputs:
command: 'pack'
packagesToPack: 'SQLite.Core.nuspec'
versioningScheme: 'off'
- publish: $(Build.ArtifactStagingDirectory)
artifact: NugetPackage
- task: NuGetCommand@2
enabled: true
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: '7ab38f4e-5a57-4d70-84f4-94dd9bc5d6df/f762697f-09fa-4960-89a1-64e48069bf6a'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))