-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappveyor.yml
More file actions
212 lines (189 loc) · 8.08 KB
/
Copy pathappveyor.yml
File metadata and controls
212 lines (189 loc) · 8.08 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
version: build.{build}
image: Visual Studio 2026
skip_tags: true
skip_commits:
files:
- .github/
- docs/
- misc/
- README.md
- LICENSE
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- SECURITY.md
environment:
github_access_token:
secure: gtEHCUmmDjYfrp/NEe2qUHbXNkSOJlKv+p6VxRIP3UCUjizdyws+qQ5do45El8Zad5rkhIIiAvNKABQFKlpCKHOXkdEegn3AsrCw9+9qyoi0e2wpbqMZ7aP7A8D2Yckb
init:
- cmd: git config --global core.autocrlf true
- cmd: setx IGNORE_NORMALISATION_GIT_HEAD_MOVE 1
- cmd: setx DOTNET_NO_WORKLOAD_UPDATE_NOTIFICATION 1
- cmd: setx DOTNET_CLI_TELEMETRY_OPTOUT 1
- cmd: setx DOTNET_NOLOGO 1
install:
# - ps: |
# Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile "$env:temp\dotnet-install.ps1"
# & $env:temp\dotnet-install.ps1 -Architecture x64 -Version '10.0.100' -InstallDir "$env:ProgramFiles\dotnet"
- cmd: npm install -g @vscode/vsce
- pwsh: . ./conformance.ps1; Install-ConformanceDependencies
- pwsh: ./install-gitversion.ps1
- pwsh: ./distribution/install-iscc.ps1
- cmd: RefreshEnv.cmd
- cmd: dotnet tool restore
before_build:
- pwsh: Write-Host "Target branch is '$($env:APPVEYOR_REPO_BRANCH)'"
- cmd: gitversion /output buildserver /verbosity Minimal
- pwsh: Write-Host "Building Expressif version version $($env:GitVersion_SemVer)"
- pwsh: |
. "$env:APPVEYOR_BUILD_FOLDER\github.ps1"
if (($env:APPVEYOR_REPO_BRANCH -eq "main") -and ($null -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)) {
$context = [PSCustomObject] @{
Id = $env:APPVEYOR_REPO_COMMIT
Owner = ($env:APPVEYOR_REPO_NAME -Split '/')[0]
Repository = ($env:APPVEYOR_REPO_NAME -Split '/')[1]
SecretToken = $env:github_access_token
}
foreach($id in ($context | Get-Commit-Associated-Pull-Requests)) {
$context.Id = $id
$context | Set-Pull-Request-Expected-Labels -Config '.github\conventional_commits_labels.json'
}
} else {
Write-Host 'Not a merge on main built on appveyor. Skipping mapping conventional commits and labels.'
}
build_script:
- dotnet build Expressif.sln -p:version="%GitVersion_SemVer%" -c Release /p:ContinuousIntegrationBuild=true --nologo
- pwsh: |
& .\generate-info.ps1 function
& .\generate-info.ps1 predicate
& .\generate-info.ps1 accumulator
- pwsh: |
Push-Location ".\Expressif.Syntax"
try {
.\New-tmBundle.ps1 -Bundle "expressif-syntax" -Version $env:GitVersion_SemVer
}
finally {
Pop-Location
}
test_script:
- pwsh: |
. ./Conformance.ps1
$validationResult = Validate-Conformance -Path "./conformance"
if ($validationResult -gt 0) {
throw "Conformance validation failed with $validationResult violation(s). Test step aborted."
}
- cmd: dotnet test Expressif.Testing -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=../.coverage/coverage.Expressif.xml /p:Threshold=10 /p:ThresholdType=line --test-adapter-path:. --logger:Appveyor --no-build --nologo
- pwsh: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe
.\codecov.exe --dir "./.coverage/"
- cmd: dotnet test Expressif.Testing -c Release --framework net10.0 --no-build --nologo --filter "TestCategory=conformance" --logger:"nunit;LogFilePath=./../conformance/bin/Expressif.Conformance.DotNet.xml"
after_test:
- cmd: dotnet pack Expressif -p:version="%GitVersion_SemVer%" -c Release --include-symbols --no-build --nologo
- pwsh: |
. ./Conformance.ps1
$conformanceVersion = Get-ConformanceVersion -Warn
Package-Conformance -Version $conformanceVersion
if (($env:APPVEYOR_REPO_BRANCH -eq "main") -and ($null -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)) {
Tag-Conformance -Version $conformanceVersion -Warn
}
else {
Write-Host "Not on main (or pull request). Conformance tagging skipped."
}
./Export-ConformanceReport.ps1 `
-Path "./conformance" `
-ReportPath "./conformance/bin/Expressif.Conformance.DotNet.xml" `
-OutputYamlPath "./conformance/bin/expressif.conformance.dotnet.$($env:GitVersion_SemVer).yaml" `
-Platform "dotnet" `
-NUnit
- pwsh: distribution/build-distribution.ps1 -Version $env:GitVersion_SemVer -Configuration Release
artifacts:
- path: '**\*.nupkg'
- path: '**\*.snupkg'
- path: '**\*.vsix'
- path: '**\Expressif.Conformance.*.zip'
- path: '**\Expressif.Conformance.*.yaml'
- path: '**\bin\archives\Expressif-*.*'
- path: '**\bin\installers\Expressif-*-setup.exe*'
deploy:
- provider: NuGet
api_key:
secure: h9Ya9xxJClhyreQwiQRG8YJmnX2m5GGYVoJ7YXwEtkDmsLl2WjWNrLejsn/jyOKY
skip_symbols: false
artifact: /.*(\.|\.s)nupkg/
on:
branch: main
on_success:
- pwsh: |
. "$env:APPVEYOR_BUILD_FOLDER\github.ps1"
if (($env:APPVEYOR_REPO_BRANCH -eq "main") -and ($null -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)) {
if ($env:GitVersion_Patch -eq '0' -or $env:GitVersion_Patch -eq 0) {
$context = [PSCustomObject] @{
Owner = ($env:APPVEYOR_REPO_NAME -Split '/')[0]
Repository = ($env:APPVEYOR_REPO_NAME -Split '/')[1]
SecretToken = $env:github_access_token
}
if (-not ($context | Check-Release-Published -Tag "v$($env:GitVersion_SemVer)")) {
$context | Publish-Release `
-Tag "v$($env:GitVersion_SemVer)" `
-Name "$(($env:APPVEYOR_REPO_NAME -Split '/')[1]) $($env:GitVersion_SemVer)" `
-ReleaseNotes `
-DiscussionCategory 'Announcements'
Start-Sleep -Seconds 5
}
$context | Upload-Release-Assets `
-Tag "v$($env:GitVersion_SemVer)" `
-Path "./Expressif.Syntax/bin/"
$context | Upload-Release-Assets `
-Tag "v$($env:GitVersion_SemVer)" `
-Path "./conformance/bin/"
$context | Upload-Release-Assets `
-Tag "v$($env:GitVersion_SemVer)" `
-Path "./conformance/bin/" `
-Extensions @("yaml")
$context | Upload-Release-Assets `
-Tag "v$($env:GitVersion_SemVer)" `
-Path "./distribution/bin/archives/" `
-Extensions @("zip", "tar.gz")
$context | Upload-Release-Assets `
-Tag "v$($env:GitVersion_SemVer)" `
-Path "./distribution/bin/installers/" `
-Extensions @("exe")
} else {
Write-Host "No release published on GitHub when patch is not set to zero."
}
} else {
Write-Host "No release published on GitHub when not on branch main."
}
- pwsh: |
if (git status --porcelain) {
Write-Host "Update of Library index needed"
& .\update-index.ps1
Write-Host "Update of docs needed"
& .\update-homepage.ps1
& .\update-docs.ps1 function special
& .\update-docs.ps1 function text
& .\update-docs.ps1 function numeric
& .\update-docs.ps1 function temporal
& .\update-docs.ps1 function io
& .\update-docs.ps1 function array
& .\update-docs.ps1 accumulator array
& .\update-docs.ps1 predicate special
& .\update-docs.ps1 predicate text
& .\update-docs.ps1 predicate numeric
& .\update-docs.ps1 predicate temporal
& .\update-docs.ps1 predicate boolean
& .\update-examples.ps1 builder expression
& .\update-examples.ps1 builder predication
& .\update-examples.ps1 serializers
Write-Host "Update of README.md needed"
& .\update-readme.ps1 function
& .\update-readme.ps1 predicate
& git config --global credential.helper store
Set-Content -Path "$HOME\.git-credentials" -Value "https://$($env:github_access_token):x-oauth-basic@github.com`n" -NoNewline
& git config --global user.email "no-reply@nbiguity.io"
& git config --global user.name "AppVeyor bot"
& git add --all
& git status
& git commit -m "docs: update the automatically generated documentation"
& git push origin
}