-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
87 lines (79 loc) · 2.9 KB
/
azure-pipelines.yml
File metadata and controls
87 lines (79 loc) · 2.9 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
parameters:
- name: release
default: false
type: boolean
variables:
- group: rudiments-sonatype
- name: isMaster
value: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
- name: isDevelop
value: $[eq(variables['Build.SourceBranch'], 'refs/heads/develop')]
- name: triggeredByTag
value: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/')]
pr:
- master
- develop
trigger:
branches:
include:
- master
- develop
tags:
include:
- '*'
pool:
vmImage: 'ubuntu-latest'
jobs:
- job: publish_unit_testing_report
displayName: 'Publish unit testing report for branch develop'
condition: eq('${{ parameters.release }}', false)
steps:
- task: Gradle@2
name: gradlew
displayName: 'Run unit tests and publish report'
inputs:
gradleWrapperFile: 'gradlew'
tasks: 'build test'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
testRunTitle: 'Unit tests report for develop'
# - script: |
# bash <(curl -s https://codecov.io/bash)
# displayName: 'Publish code coverage report to codecov.io'
- job: push_snapshots
displayName: 'Push latest Rudiments snapshots to Maven Snapshots repo'
condition: eq(variables.isDevelop, true)
steps:
- script: |
./gradlew test uploadArchives -PnexusUsername=$SONATYPE_USERNAME -PnexusPassword=$SONATYPE_PASSWORD
displayName: 'Push latest Rudiments snapshots to Maven Snapshots repo'
env:
SONATYPE_USERNAME: $(SONATYPE_USERNAME)
SONATYPE_PASSWORD: $(SONATYPE_PASSWORD)
- job: push_tagged_jars
displayName: 'Push tagged Rudiments jars to Maven Snapshots repo'
condition: eq(variables.triggeredByTag, true)
steps:
- script: |
./gradlew uploadArchives -Ptagged-build -PnexusUsername=$SONATYPE_USERNAME -PnexusPassword=$SONATYPE_PASSWORD
displayName: 'Push tagged Rudiments jars to Maven Snapshots repo'
env:
SONATYPE_USERNAME: $(SONATYPE_USERNAME)
SONATYPE_PASSWORD: $(SONATYPE_PASSWORD)
- job: release
displayName: 'Release Rudiments to Maven Central'
condition: and(eq('${{ parameters.release }}', true), eq(variables.isMaster, true))
steps:
- task: DownloadSecureFile@1
name: secretkeys
displayName: 'Download gpg secret keys'
inputs:
secureFile: 'secret-keys.gpg'
- script: |
./gradlew uploadArchives -PnexusUsername=$SONATYPE_USERNAME -PnexusPassword=$SONATYPE_PASSWORD -Psigning.keyId=$GPG_KEY_ID -Psigning.password=$GPG_PASSPHRASE -Psigning.secretKeyRingFile=$(secretkeys.secureFilePath)
displayName: 'Release Rudiments to Maven Central'
env:
SONATYPE_USERNAME: $(SONATYPE_USERNAME)
SONATYPE_PASSWORD: $(SONATYPE_PASSWORD)
GPG_KEY_ID: $(GPG_KEY_ID)
GPG_PASSPHRASE: $(GPG_PASSPHRASE)