-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
122 lines (85 loc) · 3.49 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
version: 1.1.5.{build}
branches:
except:
- pages-ci
- gh-pages
configuration: Release
clone_folder: C:\projects\SendGrid
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}'
environment:
nuget_user: user@bricksandmortarstudio.com
nuget_password: aHlingenDPOt
install:
- ps: >-
nuget sources add -Name "Rock Stable" -Source https://ci.appveyor.com/nuget/bricks-Rock-master
before_build:
- cmd: nuget restore C:\projects\SendGrid\SendGrid.sln
build:
verbosity: minimal
after_build:
- ps: >-
#The path for the staging directory
$path = $env:APPVEYOR_BUILD_FOLDER+'\out'
#Regex for stripping directory leads for Rock .lst files
$regex = '^(\.*\\*\.)*'
New-Item $path -type directory
New-Item $path\content -type directory
New-Item $path\uninstall -type directory
New-Item $path\content\bin -type directory
New-Item $path\content\Webhooks -type directory
Copy-Item $env:APPVEYOR_BUILD_FOLDER\SendGrid\bin\Release\com.bricksandmortarstudio.SendGrid.dll $path\content\bin\
Copy-Item $env:APPVEYOR_BUILD_FOLDER\SendGrid\RockWeb\Webhooks\SendGrid.ashx $path\content\Webhooks
# Setup source and destination paths
$Src = $env:APPVEYOR_BUILD_FOLDER
$Dst = $path+'\content\bin'
# Wildcard for filter
$Extension = 'Sendgrid.Webhooks.dll'
# Get file objects recursively
Get-ChildItem -Path $Src -Filter $Extension -Recurse |
# Skip directories, because XXXReadMe.txt is a valid directory name
Where-Object {!$_.PsIsContainer} |
# For each file
ForEach-Object {
# If file exist in destination folder, rename it with directory tag
if(Test-Path -Path (Join-Path -Path $Dst -ChildPath $_.Name))
{
# Get full path to the file without drive letter and replace `\` with '-'
# [regex]::Escape is needed because -replace uses regex, so we should escape '\'
$NameWithDirTag = (Split-Path -Path $_.FullName -NoQualifier) -replace [regex]::Escape('\'), '-'
# Join new file name with destination directory
$NewPath = Join-Path -Path $Dst -ChildPath $NameWithDirTag
}
# Don't modify new file path, if file doesn't exist in target dir
else
{
$NewPath = $Dst
}
# Copy file
Copy-Item -Path $_.FullName -Destination $NewPath
}
Remove-Item $path\content\bin\* -Include '*-*'
Get-ChildItem $path\content\*.* -Recurse | Resolve-Path -Relative | Set-Content $path\uninstall\deletefile.lst
(Get-Content $path\uninstall\deletefile.lst) -replace $regex, '' | Set-Content $path\uninstall\deletefile.lst
$name = $env:APPVEYOR_PROJECT_NAME+'-v'+$env:APPVEYOR_BUILD_VERSION+'.plugin'
$command = 'cmd.exe /C 7z a -tzip -r ' + $path + '\' + $name + ' ' + $path + '\*'
Invoke-Expression -Command:$command
Get-ChildItem $path/*.plugin| % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
test: off
deploy:
- provider: GitHub
tag:
release: Version $(appveyor_build_version)
description: Description
auth_token:
secure: purnbQq+/7nii64HdaMRg++QQARjdTJ3VYVIq8EQBR7NxrTp46pw+JIxLjbL/obW
artifact: /.*\.plugin/
draft: true
prerelease: false
force_update: true
on:
APPVEYOR_REPO_TAG: true