mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 21:38:38 +00:00
CI - Added Linux build
This commit is contained in:
parent
c5a1777cf6
commit
08bef79b2f
@ -15,11 +15,9 @@ resources:
|
||||
name: Artemis-RGB/Artemis.Plugins
|
||||
ref: master
|
||||
|
||||
pool:
|
||||
vmImage: "windows-latest"
|
||||
|
||||
variables:
|
||||
windowsProject: "**/Artemis.UI.Windows/Artemis.UI.Windows.csproj"
|
||||
linuxProject: "**/Artemis.UI.Linux/Artemis.UI.Linux.csproj"
|
||||
pluginProjects: "**/Artemis.Plugins.*.csproj"
|
||||
BuildId: $(Build.BuildId)
|
||||
BuildNumber: $(Build.BuildNumber)
|
||||
@ -28,6 +26,8 @@ variables:
|
||||
|
||||
jobs:
|
||||
- job: Windows
|
||||
pool:
|
||||
vmImage: "windows-latest"
|
||||
steps:
|
||||
- checkout: self
|
||||
path: s/Artemis
|
||||
@ -119,3 +119,98 @@ jobs:
|
||||
clean: false
|
||||
preservePaths: true
|
||||
trustSSL: false
|
||||
|
||||
- job: Linux
|
||||
pool:
|
||||
vmImage: "ubuntu-latest"
|
||||
steps:
|
||||
- checkout: self
|
||||
path: s/Artemis
|
||||
- checkout: Plugins
|
||||
path: s/Artemis.Plugins
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: "Artemis - Publish"
|
||||
inputs:
|
||||
command: "publish"
|
||||
publishWebProjects: false
|
||||
projects: "$(linuxProject)"
|
||||
arguments: '--configuration Release --runtime linux-x64 --output $(Build.ArtifactStagingDirectory)/linux-build /nowarn:cs1591'
|
||||
zipAfterPublish: false
|
||||
modifyOutputPath: false
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: "Artemis - Create buildinfo.json"
|
||||
inputs:
|
||||
targetType: "inline"
|
||||
script: |
|
||||
$OFS = "`r`n"
|
||||
SET-Content -Path 'buildinfo.json' -Value ('{' + $OFS + ' "BuildId": 0,' + $OFS + ' "BuildNumber": 0.0,' + $OFS + ' "SourceBranch": "",' + $OFS + ' "SourceVersion": ""' + $OFS + '}')
|
||||
workingDirectory: "$(Build.ArtifactStagingDirectory)/linux-build"
|
||||
|
||||
- task: FileTransform@1
|
||||
displayName: "Artemis - Populate buildinfo.json"
|
||||
inputs:
|
||||
folderPath: "$(Build.ArtifactStagingDirectory)/linux-build"
|
||||
fileType: "json"
|
||||
targetFiles: "**/buildinfo.json"
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: "Plugins - Insert build number into plugin.json"
|
||||
inputs:
|
||||
targetType: "inline"
|
||||
script: |
|
||||
Get-ChildItem -Recurse -Filter plugin.json |
|
||||
Foreach-Object {
|
||||
$buidNumber = "1.0.1." + $Env:BUILD_BUILDID;
|
||||
$a = Get-Content $_.FullName | ConvertFrom-Json
|
||||
$a.Version = $buidNumber;
|
||||
$a | ConvertTo-Json | Set-Content $_.FullName
|
||||
}
|
||||
workingDirectory: "Artemis.Plugins"
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: "Plugins - Publish"
|
||||
inputs:
|
||||
command: "publish"
|
||||
publishWebProjects: false
|
||||
arguments: "--configuration Release --runtime linux-x64 --output $(Build.ArtifactStagingDirectory)/linux-build/Plugins"
|
||||
projects: "$(pluginProjects)"
|
||||
zipAfterPublish: true
|
||||
|
||||
- task: PublishPipelineArtifact@1
|
||||
displayName: "Upload build to Azure Pipelines"
|
||||
inputs:
|
||||
targetPath: "$(Build.ArtifactStagingDirectory)/linux-build"
|
||||
artifact: "Artemis build"
|
||||
publishLocation: "pipeline"
|
||||
|
||||
- task: ArchiveFiles@2
|
||||
displayName: "ZIP binaries"
|
||||
inputs:
|
||||
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/linux-build"
|
||||
includeRootFolder: false
|
||||
archiveType: "zip"
|
||||
archiveFile: "$(Build.ArtifactStagingDirectory)/archive/artemis-build-linux.zip"
|
||||
replaceExistingArchive: true
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: "Calculate ZIP hash"
|
||||
inputs:
|
||||
targetType: "inline"
|
||||
script: '(Get-FileHash .\artemis-build-linux.zip).Hash | Out-File -FilePath .\hash-linux.txt'
|
||||
workingDirectory: "$(Build.ArtifactStagingDirectory)/archive"
|
||||
|
||||
- task: FtpUpload@2
|
||||
displayName: "Upload binaries to FTP"
|
||||
inputs:
|
||||
credentialsOption: "inputs"
|
||||
serverUrl: "ftp://artemis-rgb.com"
|
||||
username: "devops"
|
||||
password: "$(ftp_password)"
|
||||
rootDirectory: "$(Build.ArtifactStagingDirectory)/archive"
|
||||
filePatterns: "**"
|
||||
remoteDirectory: "/builds.artemis-rgb.com/binaries/$(Build.SourceBranchName)/$(Build.BuildNumber)"
|
||||
clean: false
|
||||
preservePaths: true
|
||||
trustSSL: false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user