Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
Fix a CI problem (#118)
Browse files Browse the repository at this point in the history
* Make the powershell script with newlines.

* Move build script to seperate file.

* Fixed git config issues.

* Switch to SSH clone.

* Switch to publishing GitHub Releases

* Switch GitHub Connection
  • Loading branch information
EraYaN authored Sep 14, 2019
1 parent 6f434a5 commit 60375d6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 26 deletions.
61 changes: 35 additions & 26 deletions .ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,42 @@ jobs:
- task: PowerShell@2
displayName: "DocFX Build"
inputs:
targetType: 'inline'
script: 'choco install docfx -y
docfx docfx.json
if ($lastexitcode -ne 0){
throw ("Error generating document")
}'

- task: CmdLine@2
displayName: "Clone Website"
inputs:
script: 'git clone https://github.com/jellyfin/jellyfin.github.io jellyfin.github.io'
workingDirectory: '$(Build.ArtifactStagingDirectory)'
#failOnStderr: false # Optional
targetType: 'filePath'
filePath: '.ci/build-in-ci.ps1'
workingDirectory: '$(Build.SourcesDirectory)'

- task: CopyFiles@2
- task: ArchiveFiles@2
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
displayName: "Package Documentation Website"
inputs:
sourceFolder: '$(Build.SourcesDirectory)/_site'
contents: '**'
targetFolder: '$(Build.ArtifactStagingDirectory)/jellyfin.github.io/docs'
cleanTargetFolder: true # Optional
overWrite: true # Optional
#flattenFolders: false # Optional
#preserveTimestamp: false # Optional
rootFolderOrFile: '$(Build.SourcesDirectory)/_site'
includeRootFolder: false
archiveType: 'tar' # Options: zip, 7z, tar, wim
tarCompression: 'gz' # Optional. Options: gz, bz2, xz, none
archiveFile: '$(Build.ArtifactStagingDirectory)/docs-$(Build.BuildId).tar.gz'
replaceExistingArchive: true
#verbose: # Optional
#quiet: # Optional

- task: CmdLine@2
displayName: "Add files to website"
- task: GitHubRelease@0
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
displayName: "Create GitHub release"
inputs:
script: 'git add docs && git commit -m "Documentation update" && git push origin'
workingDirectory: '$(Build.ArtifactStagingDirectory)/jellyfin.github.io'
#failOnStderr: false # Optional
gitHubConnection: Jellyfin Release Download
repositoryName: '$(Build.Repository.Name)'
action: 'create' # Options: create, edit, delete
target: '$(Build.SourceVersion)' # Required when action == Create || Action == Edit
tagSource: 'auto' # Required when action == Create# Options: auto, manual
#tagPattern: # Optional
#tag: # Required when action == Edit || Action == Delete || TagSource == Manual
#title: # Optional
#releaseNotesSource: 'file' # Optional. Options: file, input
#releaseNotesFile: # Optional
#releaseNotes: # Optional
assets: '$(Build.ArtifactStagingDirectory)/docs-$(Build.BuildId).tar.gz' # Optional
#assetUploadMode: 'delete' # Optional. Options: delete, replace
#isDraft: false # Optional
#isPreRelease: false # Optional
addChangeLog: true # Optional
compareWith: 'lastFullRelease' # Required when addChangeLog == True. Options: lastFullRelease, lastRelease, lastReleaseByTag
#releaseTag: # Required when compareWith == LastReleaseByTag
5 changes: 5 additions & 0 deletions .ci/build-in-ci.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
choco install docfx -y
docfx docfx.json
if ($lastexitcode -ne 0){
throw ("Error generating document")
}

0 comments on commit 60375d6

Please sign in to comment.