forked from speckleworks/SpeckleInstaller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
178 lines (166 loc) · 7.61 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
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
# General Configuration
version: 1.8.5.{build}
skip_branch_with_pr: true
# Environment Configuration
image: Visual Studio 2017
cache:
- '%LocalAppData%\NuGet\v3-cache'
environment:
my_variable:
secure: mxiydinHKH3TmtBeDKldgt7VD90uiOW/GCbUD70x5HMB7B7lWinN3A2tw2dnt17x
# version
assembly_info:
patch: true
file: AssemblyInfo.*
assembly_version: '{version}'
assembly_file_version: '{version}'
# Build Configuration
platform: Any CPU
configuration: Release
before_build:
- nuget restore
build:
project: SpeckleUpdater.sln
#verbosity: minimal
# after_build:
# - InnoSetup\ISCC.exe SpeckleInstaller.iss
after_build :
- ps: |
$apiUrl = 'https://ci.appveyor.com/api'
$token = 'v2.bngo3nen438pm58fx2n1'
$headers = @{
"Authorization" = "Bearer $token"
}
# DOWNLOAD RHINO+GH ARTIFACTS
- ps: |
$prjUrl = "$apiUrl/projects/speckleworks/specklerhino/branch/master"
$headers = @{
"Authorization" = "Bearer $token"
}
$project = Invoke-RestMethod -Method Get -Uri "$prjUrl" -Headers $headers
$jobId = $project.build.jobs[0].jobId
$artifacts = Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts" -Headers $headers
$artifact = $artifacts | Where name -eq "Release"
$artifactFileName = $artifact.fileName
$localArtifactPath = "$Env:APPVEYOR_BUILD_FOLDER\$artifactFileName"
$start_time = Get-Date
Invoke-WebRequest -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifactFileName" -OutFile $localArtifactPath -Headers $headers
$dest = "$Env:APPVEYOR_BUILD_FOLDER\SpeckleRhino"
Write-Output "Time taken downloading: $((Get-Date).Subtract($start_time).Seconds) second(s)"
Write-Output "DESTINATION=$dest"
New-Item -ItemType directory -Path $dest
7z x -o"$dest" "$localArtifactPath" -r -aoa
Write-Output "Time taken unzipping: $((Get-Date).Subtract($start_time).Seconds) second(s)"
- ls C:\projects\speckleinstaller\SpeckleRhino
# DOWNLOAD DYNAMO ARTIFACTS
- ps: |
$prjUrl = "$apiUrl/projects/speckleworks/speckledynamo/branch/master"
$headers = @{
"Authorization" = "Bearer $token"
}
$project = Invoke-RestMethod -Method Get -Uri "$prjUrl" -Headers $headers
$jobId = $project.build.jobs[0].jobId
$artifacts = Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts" -Headers $headers
$artifact = $artifacts | Where name -eq "Release"
$artifactFileName = $artifact.fileName
$localArtifactPath = "$Env:APPVEYOR_BUILD_FOLDER\$artifactFileName"
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifactFileName" -OutFile $localArtifactPath -Headers $headers
$dest = "$Env:APPVEYOR_BUILD_FOLDER\SpeckleDynamo"
New-Item -ItemType directory -Path $dest
7z x -o"$dest" "$localArtifactPath" -r -aoa
- ls C:\projects\speckleinstaller\SpeckleDynamo
# DOWNLOAD REVIT ARTIFACTS
- ps: |
$prjUrl = "$apiUrl/projects/speckleworks/specklerevitreboot/branch/master"
$headers = @{
"Authorization" = "Bearer $token"
}
$project = Invoke-RestMethod -Method Get -Uri "$prjUrl" -Headers $headers
$jobId = $project.build.jobs[0].jobId
$artifacts = Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts" -Headers $headers
$artifact = $artifacts | Where name -eq "Release"
$artifactFileName = $artifact.fileName
$localArtifactPath = "$Env:APPVEYOR_BUILD_FOLDER\$artifactFileName"
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifactFileName" -OutFile $localArtifactPath -Headers $headers
$dest = "$Env:APPVEYOR_BUILD_FOLDER\SpeckleRevit"
New-Item -ItemType directory -Path $dest
7z x -o"$dest" "$localArtifactPath" -r -aoa
- ls C:\projects\speckleinstaller\SpeckleRevit
# DOWNLOAD specklecoregeometry ARTIFACTS
- ps: |
$prjUrl = "$apiUrl/projects/speckleworks/specklecoregeometry/branch/master"
$headers = @{
"Authorization" = "Bearer $token"
}
$project = Invoke-RestMethod -Method Get -Uri "$prjUrl" -Headers $headers
$jobId = $project.build.jobs[0].jobId
$artifacts = Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts" -Headers $headers
$artifact = $artifacts | Where name -eq "Release"
$artifactFileName = $artifact.fileName
$localArtifactPath = "$Env:APPVEYOR_BUILD_FOLDER\$artifactFileName"
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifactFileName" -OutFile $localArtifactPath -Headers $headers
$dest = "$Env:APPVEYOR_BUILD_FOLDER\SpeckleCoreGeometry"
New-Item -ItemType directory -Path $dest
7z x -o"$dest" "$localArtifactPath" -r -aoa
- ls C:\projects\speckleinstaller\SpeckleCoreGeometry
# DOWNLOAD speckleelements ARTIFACTS
- ps: |
$prjUrl = "$apiUrl/projects/speckleworks/speckleelements/branch/master"
$headers = @{
"Authorization" = "Bearer $token"
}
$project = Invoke-RestMethod -Method Get -Uri "$prjUrl" -Headers $headers
$jobId = $project.build.jobs[0].jobId
$artifacts = Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts" -Headers $headers
$artifact = $artifacts | Where name -eq "Release"
$artifactFileName = $artifact.fileName
$localArtifactPath = "$Env:APPVEYOR_BUILD_FOLDER\$artifactFileName"
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifactFileName" -OutFile $localArtifactPath -Headers $headers
$dest = "$Env:APPVEYOR_BUILD_FOLDER\SpeckleElements"
New-Item -ItemType directory -Path $dest
7z x -o"$dest" "$localArtifactPath" -r -aoa
- ls C:\projects\speckleinstaller\SpeckleElements
# DOWNLOAD specklestructural ARTIFACTS
- ps: |
$prjUrl = "$apiUrl/projects/speckleworks/specklestructural/branch/master"
$headers = @{
"Authorization" = "Bearer $token"
}
$project = Invoke-RestMethod -Method Get -Uri "$prjUrl" -Headers $headers
$jobId = $project.build.jobs[0].jobId
$artifacts = Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts" -Headers $headers
$artifact = $artifacts | Where name -eq "Release"
$artifactFileName = $artifact.fileName
$localArtifactPath = "$Env:APPVEYOR_BUILD_FOLDER\$artifactFileName"
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifactFileName" -OutFile $localArtifactPath -Headers $headers
$dest = "$Env:APPVEYOR_BUILD_FOLDER\SpeckleStructural"
New-Item -ItemType directory -Path $dest
7z x -o"$dest" "$localArtifactPath" -r -aoa
- ls C:\projects\speckleinstaller\SpeckleStructural
# EXECUTE INNO
- InnoSetup\ISCC.exe SpeckleInstaller.iss
artifacts:
path: Speckle.exe
name: Release
deploy:
release: Speckle-v$(appveyor_build_version)
tag: $(APPVEYOR_REPO_TAG_NAME)
description: 'The best Speckle so far...'
provider: GitHub
auth_token:
secure: D5tPFvdQMg9sIe0sSvQjEWw4KAdOk1jyxNwiH5qP5DpDmUH6n6NgTdA+56vXS1Pe # your encrypted token from GitHub
artifact: Speckle.exe
draft: false
prerelease: true
force_update: true
on: # release from master branch only
appveyor_repo_tag: true # deploy on tag push only
notifications:
- provider: Slack
incoming_webhook:
secure: 9Kt/ImvGdsQ/dzmRdSaMIG+BO0R29MOJC7eZZnK5m5TyWwE+4nofEcYlb/r4lh9Z1Dx/bR+7oQtgAYO3W5s+qJshkT6Is9irYw3TfMZX7/M=
channel: '#devtalk'
template: Build <{{buildUrl}}|#{{buildVersion}}> (<{{commitUrl}}|{{commitId}}>) of {{repositoryName}}@{{branch}}) by {{commitAuthor}} {{status}} in {{duration}}
on_build_success: false
on_build_failure: true
on_build_status_changed: true