Skip to content

Commit

Permalink
[CI] Set year within CI
Browse files Browse the repository at this point in the history
  • Loading branch information
melanchall committed Dec 24, 2023
1 parent 1748f93 commit 0aa80dd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Docs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"_enableSearch": true,
"_appLogoPath": "images/logo.png",
"_appFaviconPath": "images/favicon.png",
"_appFooter": "2023 / Generated by <a href=\"https://dotnet.github.io/docfx\">DocFX</a>",
"_appFooter": "0000 / Generated by <a href=\"https://dotnet.github.io/docfx\">DocFX</a>",
"_disableContribution": true
},
"template": [
Expand All @@ -49,4 +49,4 @@
"dest": "_site",
"xrefService": [ "https://xref.docs.microsoft.com/query?uid={uid}" ]
}
}
}
2 changes: 1 addition & 1 deletion DryWetMidi/Melanchall.DryWetMidi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Build musical compositions.
* Perform complex musical tasks like quantizing, notes splitting or converting MIDI files to CSV.
</Description>
<Copyright>Copyright © Melanchall 2023</Copyright>
<Copyright>Copyright © Melanchall 0000</Copyright>
<PackageTags>midi smf music composing notes chords device playback record</PackageTags>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down
9 changes: 8 additions & 1 deletion Resources/CI/Templates/job-build-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,29 @@ jobs:
path: '$(Pipeline.Workspace)\NativeLibraries'

- task: PowerShell@2
displayName: Setup version
displayName: Setup metadata
inputs:
targetType: 'inline'
script: |
$filePath = Resolve-Path "DryWetMidi\Melanchall.DryWetMidi.csproj"
$xml = New-Object xml
$xml.PreserveWhitespace = $true
$xml.Load($filePath)
$version = $xml.Project.PropertyGroup[1].Version
Write-Host "Current version is $version"
$newVersion = "$(LibraryVersion)"
$xml.Project.PropertyGroup[1].Version = $newVersion
Write-Host "New version: $($xml.Project.PropertyGroup[1].Version)"
Write-Host "Setting release notes up..."
$xml.Project.PropertyGroup[1].PackageReleaseNotes = "https://github.com/melanchall/drywetmidi/releases/tag/v$(LibraryVersion)"
Write-Host "Release notes: $($xml.Project.PropertyGroup[1].PackageReleaseNotes)"
Write-Host "Setting copyright up..."
$xml.Project.PropertyGroup[1].Copyright = "Copyright © Melanchall $((Get-Date).Year)"
Write-Host "Copyright: $($xml.Project.PropertyGroup[1].Copyright)"
$xml.Save($filePath)
- task: PowerShell@2
Expand Down
11 changes: 10 additions & 1 deletion Resources/CI/Templates/step-build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ steps:
inputs:
targetType: 'inline'
script: choco install docfx -y --version $(DocFxVersion)


- task: PowerShell@2
displayName: Setup year
inputs:
targetType: 'inline'
script: |
$filePath = Resolve-Path "Docs\docfx.json"
$content = Get-Content $filePath -Raw
Set-Content $filePath -Value ($content -replace '0000', (Get-Date).Year)
- task: PowerShell@2
displayName: Build docs
inputs:
Expand Down
10 changes: 8 additions & 2 deletions Resources/CI/build-artifacts-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,11 @@ steps:
- task: PublishPipelineArtifact@1
displayName: Publish 'Docs' artifact
inputs:
targetPath: Docs\_site
artifact: Docs
targetPath: 'Docs\_site'
artifact: Docs

- task: PublishPipelineArtifact@1
displayName: Publish 'docfx.json' artifact
inputs:
targetPath: 'Docs\docfx.json'
artifact: docfx.json

0 comments on commit 0aa80dd

Please sign in to comment.