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.

162 lines
4.8 KiB

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