forked from jenkinsci/uipath-automation-package-plugin
-
Notifications
You must be signed in to change notification settings - Fork 3
/
job.ci.build.yml
47 lines (42 loc) · 2.03 KB
/
job.ci.build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
steps:
- ${{ if and(ne(variables['Build.SourceBranch'], 'refs/heads/master'), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) }}:
- powershell: |
Write-Host "Package version $($env:AlphaBetaPluginVersionCounter)-alpha"
$content = Get-Content pom.xml
$content = $content -replace '-SNAPSHOT</version>', "-$($env:AlphaBetaPluginVersionCounter)-alpha</version>"
Set-Content -Path pom.xml -Value $content
displayName: "Set BuildVersion=alpha"
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/release/') }}:
- powershell: |
Write-Host "Package version $($env:AlphaBetaPluginVersionCounter)-beta"
$content = Get-Content pom.xml
$content = $content -replace '-SNAPSHOT</version>', "-$($env:AlphaBetaPluginVersionCounter)-beta</version>"
Set-Content -Path pom.xml -Value $content
displayName: "Set BuildVersion=alpha"
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/master') }}:
- powershell: |
(Get-Content pom.xml) | %{ $_ -replace '-SNAPSHOT</version>','</version>'} | Set-Content pom.xml
displayName: "Set BuildVersion=final"
- task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1
displayName: 'Prepare analysis on SonarCloud'
inputs:
SonarCloud: 'JenkinsSonar'
organization: ui
scannerMode: Other
- task: Maven@3
displayName: 'Build plugin package (Java 11)'
inputs:
javaHomeOption: 'JDKVersion'
jdkVersionOption: 1.11
mavenPomFile: $(MavenPOMFile)
testResultsFiles: '**/TEST-*.xml'
sonarQubeRunAnalysis: false
findBugsRunAnalysis: false
sqMavenPluginVersionChoice: 'latest'
options: '-DskipTests -Duser.name=UiPath --no-transfer-progress -Dmaven.artifact.threads=16 -T 4 -DrerunFailingTestsCount=0'
- ${{ if eq(parameters.publishArtifacts, 'true') }}:
- task: PublishBuildArtifacts@1
displayName: 'Publish package'
inputs:
PathtoPublish: '$(system.defaultworkingdirectory)/target/uipath-automation-package.hpi'
ArtifactName: Packages