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.

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