You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

169 lines
4.9 KiB

5 years ago
5 years ago
  1. version: 'BSIPA-{branch}-{build}'
  2. environment:
  3. bsipa_version: '4.0.0-beta.1'
  4. gh_token:
  5. secure: E42gl/yepETuoLSwbJZ1GmEIPK6cCJu6zkd59NA21XiICtEV6COOLW7aehi1tcVU
  6. do_deploy: true
  7. BuildForBeatSaber: 'false'
  8. matrix:
  9. - BUILD_DOC: 'no'
  10. - BUILD_DOC: 'yes'
  11. pull_requests:
  12. do_not_increment_build_number: true
  13. install:
  14. - git submodule update --init --recursive
  15. - nuget restore
  16. - ps: |
  17. if (-Not $env:APPVEYOR_PULL_REQUEST_TITLE -And $env:BUILD_DOC -Eq 'yes')
  18. {
  19. #git checkout $env:APPVEYOR_REPO_BRANCH -q
  20. choco install docfx -y
  21. }
  22. image: Visual Studio 2019
  23. configuration: Release
  24. platform:
  25. - x64-Net4
  26. - x86-Net4
  27. - x64-Net3
  28. - x86-Net3
  29. artifacts: # When Net3 is added, this will need to be moved to the for block to only run for Net4 builds
  30. - path: BSIPA-ModList/bin/Release
  31. name: ModList
  32. - path: BSIPA-Meta/bin/$(platform)/$(configuration)
  33. name: BSIPA-$(platform)
  34. matrix:
  35. exclude:
  36. # Don't exclude Release_Net4|x64
  37. - BUILD_DOC: 'yes' # Add one of these for most configuration sets, so we don't dupe
  38. platform: x86-Net4
  39. - BUILD_DOC: 'yes' # Add one of these for most configuration sets, so we don't dupe
  40. platform: x64-Net3
  41. - BUILD_DOC: 'yes' # Add one of these for most configuration sets, so we don't dupe
  42. platform: x86-Net3
  43. before_build:
  44. - ps: |
  45. echo $env:Configuration $env:Platform $env:BuildingInsideVisualStudio
  46. for:
  47. -
  48. matrix:
  49. only:
  50. - platform: x64-Net4
  51. environment:
  52. BuildForBeatSaber: 'true'
  53. -
  54. matrix:
  55. except:
  56. - BUILD_DOC: 'yes'
  57. skip_tags: true
  58. -
  59. matrix:
  60. except:
  61. - BUILD_DOC: 'no'
  62. artifacts:
  63. environment:
  64. do_deploy: false
  65. skip_tags: false
  66. build_script:
  67. - ps: |
  68. if ($env:APPVEYOR_REPO_BRANCH -eq 'master')
  69. {
  70. cd docs
  71. function Git-Do {
  72. git config --global core.autocrlf true
  73. git config --global credential.helper store
  74. Add-Content "$HOME\.git-credentials" "https://$($env:gh_token):[email protected]`n"
  75. git config --global user.email $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL
  76. git config --global user.name $env:APPVEYOR_REPO_COMMIT_AUTHOR
  77. git clone -q "https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded.git" -b gh-pages origin_site
  78. if (-Not (Test-Path origin_site/tags))
  79. { New-Item -ItemType directory -Path origin_site/tags }
  80. }
  81. function Do-DocFX
  82. {
  83. Add-Content link_branch.json "{`"_gitContribute`":{`"sourceBranch`":`"$env:APPVEYOR_REPO_COMMIT`",`"apiSpecFolder`":`"docs/override`"}}"
  84. #& docfx metadata
  85. #& docfx build --globalMetadataFiles link_branch.json @Args
  86. #if ($lastexitcode -ne 0){
  87. # throw [System.Exception] "docfx build failed with exit code $lastexitcode."
  88. #}
  89. powershell .\build.ps1
  90. if ($lastexitcode -ne 0){
  91. throw [System.Exception] "docfx build failed with exit code $lastexitcode."
  92. }
  93. }
  94. if ($env:APPVEYOR_REPO_TAG -eq "true")
  95. { # Copy current site into tags
  96. & Do-DocFX
  97. & Git-Do
  98. cd origin_site # make things a bit easier
  99. $tagPath = "tags/$env:APPVEYOR_REPO_TAG_NAME"
  100. Move-Item ../_site $tagPath
  101. git add -A 2>&1
  102. git commit -q -a -m "Saved tag $env:APPVEYOR_REPO_TAG_NAME" 2>&1
  103. }
  104. elseif (-Not $env:APPVEYOR_PULL_REQUEST_TITLE)
  105. { # Generate docs
  106. & Do-DocFX
  107. & Git-Do
  108. Move-Item origin_site/.git _site
  109. Move-Item origin_site/tags _site
  110. CD _site
  111. git add -A 2>&1
  112. git commit -q -a -m "$env:APPVEYOR_REPO_COMMIT_MESSAGE -- Generated Docs" 2>&1
  113. }
  114. git push -q origin gh-pages 2>&1
  115. }
  116. branches:
  117. except:
  118. - gh-pages
  119. cache:
  120. - '%LocalAppData%\NuGet\v3-cache' # NuGet v3
  121. build:
  122. verbosity: normal
  123. project: BSIPA.sln
  124. deploy:
  125. - provider: GitHub
  126. release: BSIPA $(bsipa_version)-draft
  127. tag: $(bsipa_version)-d
  128. description: |
  129. **Build:** [$(bsipa_version)-$(APPVEYOR_BUILD_NUMBER)](https://ci.appveyor.com/project/nike4613/beatsaber-ipa-reloaded-9smsb/builds/$(APPVEYOR_BUILD_ID))
  130. **Latest Commit:** $(APPVEYOR_REPO_COMMIT)
  131. - `$(APPVEYOR_REPO_COMMIT_MESSAGE)`
  132. - `$(APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED)`
  133. auth_token:
  134. secure: KhF3q/zWEFwrW0QeZLqE3NAkWR4u9iVhsmcyzXvwwJ28fUy+MzW4CWBx3RxNM60t
  135. artifact: '/.*[^_]\.zip/'
  136. draft: true
  137. force_update: true
  138. on:
  139. branch: master
  140. APPVEYOR_REPO_TAG: false
  141. do_deploy: true