-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines.yml
60 lines (56 loc) · 1.78 KB
/
azure-pipelines.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
48
49
50
51
52
53
54
55
56
57
58
59
60
# Android
# Build your Android project with Gradle.
# Add steps that test, sign, and distribute the APK, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/android
parameters:
- name: publishBuild
displayName: Publish new build?
type: boolean
default: false
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'SonarCloud'
organization: 'outsystemsrd'
scannerMode: 'CLI'
configMode: 'file'
- task: Gradle@3
displayName: Build Project
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx4096M'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.17'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
tasks: 'clean build'
- task: CmdLine@2
displayName: Validate pom.xml
inputs:
script: |
/usr/bin/mvn -version
/usr/bin/mvn -f /home/vsts/work/1/s/pom.xml help:effective-pom
- task: MavenAuthenticate@0
displayName: Authenticate in public repo
condition: or(${{parameters.publishBuild}}, eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
artifactsFeeds: 'PublicArtifactRepository'
- task: Bash@3
displayName: Deploy file
condition: or(${{parameters.publishBuild}}, eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
targetType: 'inline'
script: |
/usr/bin/mvn deploy:deploy-file \
-DpomFile=/home/vsts/work/1/s/pom.xml \
-DgeneratePom=true \
-Dfile=build/outputs/aar/OSInAppBrowserLib-release.aar \
-Dpackaging=aar \
-DrepositoryId=PublicArtifactRepository \
-Durl=https://pkgs.dev.azure.com/OutSystemsRD/9e79bc5b-69b2-4476-9ca5-d67594972a52/_packaging/PublicArtifactRepository/maven/v1