Skip to content

Commit 4ba812c

Browse files
authored
Merge pull request #82 from kskinoue0612/issue-81
Closes #81
2 parents f5f0373 + ced3295 commit 4ba812c

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

appveyor.yml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ environment:
1313
iric_online_update_access_token:
1414
secure: WDcJrM7sx9jagk006F3OtXqomb90MlJcRIs8LoAyvT0wVzvG+UxeaW+oG9GWb1t8
1515
kskinoue0612_access_token:
16-
secure: oVRLqEy3Z23kImxSlNOKZcRwO/R/ZJV202rigsj2IBXGrcm/u0cQHseHr6NS2JGV
16+
secure: n1Pd5On6t3P0OlAAHEoQpugccvsRvXcUmQjmgFI/hsSFkXqNKNxyC4kF1/KllT4Q
1717
kskinoue0612_online_update_access_token:
1818
secure: GzdhhFKWjeLDM22U4ZcrMkAGEEnZLMVbfBR9W8uRQ/LqOtvX2qjPXvC3nvxxWeUc
1919

@@ -37,7 +37,7 @@ init:
3737
- ps: $UploadRelease = (($env:Configuration -eq "Release") -AND ($env:APPVEYOR_REPO_BRANCH -eq "master") -AND (!$env:APPVEYOR_PULL_REQUEST_NUMBER) -AND ($env:SGEN -eq "vs2013-x64"))
3838
- ps: Write-Output $UploadRelease
3939
# Only commit and push to master branch or debug-appveyor branch (for testing)
40-
- ps: $CommitAndPush = (($env:Configuration -eq "Release") -AND ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2013") -AND (($env:APPVEYOR_REPO_BRANCH -eq "master") -OR ($env:APPVEYOR_REPO_BRANCH -eq "push_to_online_update")) -AND (!$env:APPVEYOR_PULL_REQUEST_NUMBER))
40+
- ps: $CommitAndPush = (($env:Configuration -eq "Release") -AND ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2013") -AND (($env:APPVEYOR_REPO_BRANCH -eq "master") -OR ($env:APPVEYOR_REPO_BRANCH -eq "develop") -OR ($env:APPVEYOR_REPO_BRANCH -eq "push_to_online_update")) -AND (!$env:APPVEYOR_PULL_REQUEST_NUMBER))
4141
- ps: Write-Output $CommitAndPush
4242

4343
# doesn't seem to be able to use environmental vars
@@ -204,16 +204,24 @@ on_success:
204204
}
205205
206206
# update data\definition.xml and meta\package.xml from dev_src\packages\gui.prepost
207-
$v=(Select-String -Path dev_src\packages\gui.prepost\meta\package.xml -Pattern "(?<=<Version>)(.*)(?=</Version>)").Matches.Value -split "\."
207+
208+
if ($env:APPVEYOR_REPO_BRANCH -eq "master") {
209+
$v=(Select-String -Path prod_src\packages\gui.prepost\meta\package.xml -Pattern "(?<=<Version>)(.*)(?=</Version>)").Matches.Value -split "\."
210+
$files=@('prod_src\packages\gui.prepost\data\definition.xml', `
211+
'prod_src\packages\gui.prepost\meta\package.xml')
212+
}
213+
if ($env:APPVEYOR_REPO_BRANCH -eq "develop") {
214+
$v=(Select-String -Path dev_src\packages\gui.prepost\meta\package.xml -Pattern "(?<=<Version>)(.*)(?=</Version>)").Matches.Value -split "\."
215+
$files=@('dev_src\packages\gui.prepost\data\definition.xml', `
216+
'dev_src\packages\gui.prepost\meta\package.xml')
217+
}
208218
$v[3] = 1 + $v[3]
209219
$env:VERSION = $v -join "."
210220
$tokyo_tz = [System.TimeZoneInfo]::FindSystemTimeZoneById("Tokyo Standard Time")
211221
$tokyo_date = [System.TimeZoneInfo]::ConvertTimeFromUtc((Get-Date).ToUniversalTime(), $tokyo_tz)
212222
$env:RELEASE_DATE = $(Get-Date $tokyo_date -Format s).Substring(0,10)
213223
$env:RELEASE = $env:RELEASE_DATE -replace '-', '.'
214224
$env:CAPTION = "iRIC GUI " + $v[0] + "." + $v[1] + "." + $v[2]
215-
$files=@('dev_src\packages\gui.prepost\data\definition.xml', `
216-
'dev_src\packages\gui.prepost\meta\package.xml')
217225
foreach ($file in $files) {
218226
(Get-Content $file) | Foreach-Object {
219227
$_ -replace "(?<=<Version>)(.*)(?=</Version>)", "$env:VERSION" `
@@ -225,16 +233,22 @@ on_success:
225233
} | Set-Content $file
226234
}
227235
228-
# distribute iriclib.dll
229-
Copy-Item C:\iricdev\lib\src\iriclib-git\_build_release\INSTALL\lib\iriclib.dll \online_update\dev_src\packages\gui.prepost\data\iriclib.dll -ErrorAction Stop
230-
231-
# run repogen to build packages and Updates.xml
232-
Set-Location \online_update\dev_src -ErrorAction Stop
233-
# create qt_ifw_path.py
234-
Write-Output "QT_IFW_PATH = 'C:\\Qt\\Tools\\QtInstallerFramework\\2.0'" | Out-File -FilePath \online_update\dev_src\qt_ifw_path.py -Encoding ascii
235-
# run repogen
236-
py build_update_repository.py
237-
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
236+
if ($env:APPVEYOR_REPO_BRANCH -eq "master") {
237+
# distribute iriclib.dll
238+
Copy-Item C:\iricdev\lib\src\iriclib-git\_build_release\INSTALL\lib\iriclib.dll \online_update\prod_src\packages\gui.prepost\data\iriclib.dll -ErrorAction Stop
239+
Set-Location \online_update\prod_src -ErrorAction Stop
240+
# run repogen
241+
C:\Qt\Tools\QtInstallerFramework\2.0\bin\repogen.exe -p packages --update --include gui.prepost ..\prod
242+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
243+
}
244+
if ($env:APPVEYOR_REPO_BRANCH -eq "develop") {
245+
# distribute iriclib.dll
246+
Copy-Item C:\iricdev\lib\src\iriclib-git\_build_release\INSTALL\lib\iriclib.dll \online_update\dev_src\packages\gui.prepost\data\iriclib.dll -ErrorAction Stop
247+
Set-Location \online_update\dev_src -ErrorAction Stop
248+
# run repogen
249+
C:\Qt\Tools\QtInstallerFramework\2.0\bin\repogen.exe -p packages --update --include gui.prepost ..\dev
250+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
251+
}
238252
239253
# run normalize_updatexml.py to normalize Updates.xml.
240254
Set-Location \online_update -ErrorAction Stop

0 commit comments

Comments
 (0)