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.

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