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.

124 lines
4.3 KiB

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