|
|
- version: 'BSIPA-{branch}-{build}'
- environment:
- bsipa_version: '3.12.22'
- gh_token:
- secure: E42gl/yepETuoLSwbJZ1GmEIPK6cCJu6zkd59NA21XiICtEV6COOLW7aehi1tcVU
- pull_requests:
- do_not_increment_build_number: true
- install:
- - git submodule update --init --recursive
- - nuget restore
- - ps: |
- if (-Not $env:APPVEYOR_PULL_REQUEST_TITLE)
- {
- #git checkout $env:APPVEYOR_REPO_BRANCH -q
- choco install docfx -y
- }
- image: Visual Studio 2017
- configuration: Release
- platform: x64
- branches:
- except:
- - gh-pages
- cache:
- - '%LocalAppData%\NuGet\v3-cache' # NuGet v3
- artifacts:
- - path: IPA/bin/$(configuration)
- name: BSIPA
- - path: BSIPA-ModList/bin/$(configuration)
- name: ModList
- build:
- verbosity: normal
- project: BSIPA.sln
- skip_tags: false
- deploy:
- - provider: GitHub
- release: BSIPA $(bsipa_version)-draft
- tag: $(bsipa_version)-d
- description: |
- **Build:** [$(bsipa_version)-$(APPVEYOR_BUILD_NUMBER)](https://ci.appveyor.com/project/nike4613/beatsaber-ipa-reloaded-9smsb/builds/$(APPVEYOR_BUILD_ID)) [$(configuration)|$(platform)]
- **Latest Commit:** $(APPVEYOR_REPO_COMMIT)
- - `$(APPVEYOR_REPO_COMMIT_MESSAGE)`
- - `$(APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED)`
- auth_token:
- secure: KhF3q/zWEFwrW0QeZLqE3NAkWR4u9iVhsmcyzXvwwJ28fUy+MzW4CWBx3RxNM60t
- artifact: /.*\.zip/
- draft: true
- force_update: true
- on:
- branch: master
- APPVEYOR_REPO_TAG: false
- - provider: GitHub
- release: -ignore-
- tag: create_tag
- description: |
- **Build:** [$(bsipa_version)-$(APPVEYOR_BUILD_NUMBER)](https://ci.appveyor.com/project/nike4613/beatsaber-ipa-reloaded-9smsb/builds/$(APPVEYOR_BUILD_ID))
- auth_token:
- secure: KhF3q/zWEFwrW0QeZLqE3NAkWR4u9iVhsmcyzXvwwJ28fUy+MzW4CWBx3RxNM60t
- draft: true
- force_update: true
- on:
- branch: master
- APPVEYOR_REPO_TAG: true
- before_deploy:
- - ps: |
- if ($env:APPVEYOR_REPO_BRANCH -eq 'master')
- {
- cd docs
-
- function Git-Do {
- git config --global core.autocrlf true
- git config --global credential.helper store
- Add-Content "$HOME\.git-credentials" "https://$($env:gh_token):[email protected]`n"
- git config --global user.email $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL
- git config --global user.name $env:APPVEYOR_REPO_COMMIT_AUTHOR
- git clone -q "https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded.git" -b gh-pages origin_site
-
- if (-Not (Test-Path origin_site/tags))
- { New-Item -ItemType directory -Path origin_site/tags }
- }
-
- function Do-DocFX([string]$params)
- {
- Add-Content link_branch.json "{`"_gitContribute`":{`"sourceBranch`":`"$env:APPVEYOR_REPO_COMMIT`",`"apiSpecFolder`":`"docs/override`"}}"
- & docfx metadata
- invoke-expression "docfx build --globalMetadataFiles link_branch.json $params"
- if ($lastexitcode -ne 0){
- throw [System.Exception] "docfx build failed with exit code $lastexitcode."
- }
- }
-
- if ($env:APPVEYOR_REPO_TAG -eq "true")
- { # Copy current site into tags
- Do-DocFX "-o origin_site/tags"
-
- Git-Do
-
- cd origin_site # make things a bit easier
-
- $tagPath = "tags/$env:APPVEYOR_REPO_TAG_NAME"
- New-Item -ItemType directory -Path $tagPath
- #Copy-Item -Path (Get-ChildItem -Exclude ('.git','tags')).FullName -Destination $tagPath -Recurse
- #pushd ..
- #popd
- Move-Item tags/_site $tagPath
-
- git add -A 2>&1
- git commit -q -a -m "Saved tag $env:APPVEYOR_REPO_TAG_NAME" 2>&1
- }
- elseif (-Not $env:APPVEYOR_PULL_REQUEST_TITLE)
- { # Generate docs
- Do-DocFX ""
-
- Git-Do
-
- Move-Item origin_site/.git _site
- Move-Item origin_site/tags _site
-
- CD _site
- git add -A 2>&1
- git commit -q -a -m "$env:APPVEYOR_REPO_COMMIT_MESSAGE -- Generated Docs" 2>&1
- }
-
- git push -q origin gh-pages 2>&1
- }
|