Browse Source

initial work to remove release step as a requirement

pull/309/head
dkanada 3 years ago
parent
commit
f82b5628ff
  1. 60
      .ci/azure-pipelines.yml
  2. 2
      .ci/build-in-ci.ps1
  3. 27
      .ci/publish-to-gh-pages.sh
  4. 6
      .vscode/extensions.json
  5. 5
      docfx.json

60
.ci/azure-pipelines.yml

@ -1,16 +1,24 @@
name: $(Date:yyyyMMdd)$(Rev:.r)
pr:
autoCancel: true
trigger:
batch: true
branches:
include:
- '*'
tags:
include:
- '*'
pr:
branches:
include:
- '*'
jobs:
- job: docs_build
displayName: "Main Build"
- job: Build
displayName: 'Build'
pool:
vmImage: windows-latest
steps:
- checkout: self
clean: true
@ -18,59 +26,49 @@ jobs:
persistCredentials: true
- task: CmdLine@2
displayName: "Install Markdownlint CLI"
displayName: 'Install Markdownlint CLI'
inputs:
script: 'npm install markdownlint-cli'
workingDirectory: '$(Build.SourcesDirectory)'
- task: CmdLine@2
displayName: "Run Markdownlint"
displayName: 'Run Markdownlint'
inputs:
script: 'npx markdownlint **/*.md --ignore node_modules --ignore src'
workingDirectory: '$(Build.SourcesDirectory)'
- task: CmdLine@2
displayName: "Update Submodules"
displayName: 'Update Submodules'
inputs:
script: 'git submodule update --recursive --remote'
workingDirectory: '$(Build.SourcesDirectory)'
- task: DotNetCoreCLI@2
displayName: "Build Server Submodule"
displayName: 'Build Server Submodule'
inputs:
command: build
arguments: '--configuration Release'
workingDirectory: '$(Build.SourcesDirectory)/src/jellyfin'
- task: PowerShell@2
displayName: "DocFX Build"
displayName: 'DocFX Build'
inputs:
targetType: 'filePath'
filePath: '.ci/build-in-ci.ps1'
workingDirectory: '$(Build.SourcesDirectory)'
- task: ArchiveFiles@2
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
displayName: "Package Documentation"
condition: contains(variables['Build.SourceBranch'], 'master')
displayName: 'Package Documentation'
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)/_site'
includeRootFolder: false
archiveType: 'tar'
tarCompression: 'gz'
archiveFile: '$(Build.ArtifactStagingDirectory)/docs-$(Build.BuildId).tar.gz'
replaceExistingArchive: true
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/jellyfin-docs-$(Build.BuildId).zip'
- task: GitHubRelease@0
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
displayName: "Create GitHub Release"
- task: PublishBuildArtifacts@1
displayName: 'Publish Docs'
inputs:
gitHubConnection: Jellyfin Release Download
repositoryName: '$(Build.Repository.Name)'
action: 'create' # Options: create, edit, delete
target: '$(Build.SourceVersion)' # Required when action == Create || Action == Edit
tagSource: 'manual' # Required when action == Create# Options: auto, manual
tag: 'ci/$(Build.BuildId)' # Required when action == Edit || Action == Delete || TagSource == Manual
title: 'CI Documentation Build $(Build.BuildId)' # Optional
assets: '$(Build.ArtifactStagingDirectory)/docs-$(Build.BuildId).tar.gz' # Optional
addChangeLog: true # Optional
compareWith: 'lastFullRelease' # Required when addChangeLog == True. Options: lastFullRelease, lastRelease, lastReleaseByTag
pathToPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'jellyfin-docs-$(Build.BuildId)'
publishLocation: 'Container'

2
.ci/build-in-ci.ps1

@ -1,5 +1,5 @@
choco install docfx -y --version 2.48.1
docfx --warningsAsErrors docfx.json
if ($lastexitcode -ne 0){
throw ("Error generating document")
throw ("error generating document")
}

27
.ci/publish-to-gh-pages.sh

@ -1,18 +1,21 @@
#!/bin/bash
# Download the latest release
curl -s https://api.github.com/repos/jellyfin/jellyfin-docs/releases/latest | grep "browser_download_url.*docs-.*\.tar\.gz" | cut -d : -f 2,3 | tr -d \" | wget -O /tmp/docs.tar.gz -qi -
# clone website
git clone https://github.com/jellyfin/jellyfin.github.io
pushd jellyfin.github.io
# Clean any old files
rm -rf docs/
# remove old docs
rm -rf docs
mkdir -p docs
popd
mkdir -p docs/
pushd docs
# update docs
unzip *.zip -d jellyfin.github.io/docs
# Extract the files
tar -xzf /tmp/docs.tar.gz
popd
# commit new changes
git add docs
git commit -m 'azure update docs'
git push origin
git add docs/
git commit -m "CI Documentation update"
git push origin
# remove repository files
rm -rf jellyfin.github.io

6
.vscode/extensions.json

@ -1,13 +1,7 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"davidanson.vscode-markdownlint"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [
]
}

5
docfx.json

@ -64,7 +64,9 @@
"template": [
"default"
],
"postProcessors": [ "ExtractSearchIndex" ],
"postProcessors": [
"ExtractSearchIndex"
],
"markdownEngineName": "dfm",
"noLangKeyword": false,
"keepFileLink": false,
@ -75,6 +77,5 @@
"priority": 0.1,
"changefreq": "daily"
}
}
}

Loading…
Cancel
Save