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.

123 lines
4.1 KiB

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