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.

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