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.

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