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