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.

158 lines
4.6 KiB

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