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.

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