forked from skbkontur/db-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
101 lines (86 loc) · 3.27 KB
/
appveyor.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
version: '{build}'
skip_commits:
files:
- '**/*.md'
image: Visual Studio 2022
init:
- cmd: git config --global core.autocrlf false
nuget:
disable_publish_on_pr: true
stack: node 14
environment:
NPM_TOKEN:
secure: Gx5yyFrlELZY4DNW/uAuiXdhUADacNqi3LptQwldv8O61KpYyiDUniA8lBJ5jfne
install:
- docker-switch-linux
- docker pull selenoid/vnc:chrome_84.0
- docker-compose up -d
before_build:
- ps: |
$ErrorActionPreference = "Stop"
$tagName = $env:APPVEYOR_REPO_TAG_NAME
if ($tagName -match '^v\d+\.\d+') # tag name starts with 'vX.Y'
{
$version = $tagName.Substring(1)
$env:SHOULD_PUBLISH_NUGET_PACKAGE = "true"
Write-Host "Will publish nuget package for $tagName tag" -ForegroundColor "Green"
if ($tagName -match '^v\d+\.\d+-release') # tag name starts with 'vX.Y-release' (e.g. use 'v4.2-release.1' tag for the first patch for release v4.2)
{
$version = $version.Substring(0, $version.IndexOf("-release"))
$env:SHOULD_CREATE_RELEASE = "true"
Write-Host "Will create release for $tagName tag" -ForegroundColor "Green"
}
$matchVersion = Select-String -Path ./version.json -Pattern "`"version`": `"$version`""
if ($matchVersion -eq $null)
{
Write-Error "Version in tag ($version) does not match version in version.json"
}
}
- dotnet --info
- dotnet restore ./DbViewer.sln --verbosity minimal
- dotnet tool restore
- yarn --cwd db-viewer-ui install --frozen-lockfile
build_script:
- dotnet build --configuration Release ./DbViewer.sln
- dotnet pack --no-build --configuration Release ./DbViewer.sln
- yarn --cwd db-viewer-ui build
before_test:
- docker build -t db-viewer-api ./DbViewer.TestApi
- docker run -dp 5000:5000 --name db-viewer-api --network=db-viewer_default-network -e CASSANDRA_ADDRESS=cassandra -e POSTGRES_ADDRESS=postgres db-viewer-api
- dotnet ef database update --project ./DbViewer.TestApi/DbViewer.TestApi.csproj --no-build --configuration Release
test_script:
- dotnet jb cleanupcode DbViewer.sln --profile=CatalogueCleanup --exclude=./DbViewer.TestApi/Migrations/*.cs --verbosity=WARN
- git diff --exit-code
- dotnet test --no-build --configuration Release ./DbViewer.Tests/DbViewer.Tests.csproj
- yarn --cwd db-viewer-ui lint
after_test:
- ps: |
if ($env:SHOULD_PUBLISH_NUGET_PACKAGE -eq "true")
{
npm config set '//registry.npmjs.org/:_authToken' $env:NPM_TOKEN
$fileNames = Get-ChildItem -Path "db-viewer-ui/dist" -Recurse -Include *.tgz
foreach ($file in $fileNames)
{
Write-Host "Will publish npm package $($file.Name)" -ForegroundColor "Green"
npm publish $file.FullName --quiet
}
}
artifacts:
- path: './DbViewer*/bin/Release/*.nupkg'
- path: './db-viewer-ui/dist/*.tgz'
deploy:
- provider: NuGet
server: https://nuget.org
api_key:
secure: J0fb96dtj1vkQ9psZQVgWvua4YCdABBGvH+sqR6dTiJt8d8cUIG7V7e03+5PHkE3
skip_symbols: true
on:
SHOULD_PUBLISH_NUGET_PACKAGE: true
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: y8dDOcAtq4U1MTDJFX8f23xsvyFU1u4bhwr9Lzbkf2revNWPPTifBkWghris9v8i
draft: false
prerelease: false
on:
SHOULD_CREATE_RELEASE: true