-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazure-pipelines.yml
84 lines (84 loc) · 2.85 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# azure-pipelines.yml - configuration for Azure Pipelines
# Copyright (C) 2020 Kaz Nishimura
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
# this notice are preserved. This file is offered as-is, without any warranty.
---
trigger:
- master
- release/*
stages:
- stage: Default
jobs:
- job: Build
pool:
vmImage: ubuntu-latest
variables:
- name: maven.localRepository
value: $(Agent.BuildDirectory)/.m2/repository
- group: gpg
steps:
- task: DownloadSecureFile@1
name: Keys
condition:
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')
inputs:
secureFile: keys.asc
- task: Cache@2
inputs:
key: maven | $(Agent.OS) | **/pom.xml
path: $(maven.localRepository)
restoreKeys: |
maven | $(Agent.OS)
maven
- task: Maven@3
inputs:
options: -B -Dmaven.repo.local=$(maven.localRepository)
jdkVersion: "1.8"
- bash: |
echo '$(gpg.passphrase)' | \
sh ./setupkeys.sh '$(Keys.secureFilePath)'
displayName: Set up signing keys
condition:
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')
- task: MavenAuthenticate@0
condition:
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')
inputs:
mavenServiceConnections: ossrh
- task: Maven@3
displayName: "Maven: deploy"
condition:
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')
inputs:
goals: package gpg:sign nexus-staging:deploy
options: -B -Possrh -Dmaven.repo.local=$(maven.localRepository)
jdkVersion: "1.8"
- stage: Reporting
jobs:
- job: GenerateSite
displayName: Generate site
pool:
vmImage: ubuntu-latest
variables:
- name: maven.localRepository
value: $(Agent.BuildDirectory)/.m2/repository
steps:
- task: Cache@2
inputs:
key: maven | site | $(Agent.OS) | **/pom.xml
path: $(maven.localRepository)
restoreKeys: |
maven | site | $(Agent.OS)
maven | site
maven
- task: Maven@3
displayName: "Maven: site"
continueOnError: true
inputs:
goals: site site:stage
options: -B -Dmaven.repo.local=$(maven.localRepository)
jdkVersion: "1.11"
- publish: target/staging
artifact: site