Skip to content

Commit 5e8f90c

Browse files
committed
Provide Azure Pipelines CI/CD configurations
1 parent 5202534 commit 5e8f90c

File tree

2 files changed

+226
-0
lines changed

2 files changed

+226
-0
lines changed

.azure/build-pipeline.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
trigger:
2+
batch: true
3+
branches:
4+
include:
5+
- master
6+
7+
pr:
8+
branches:
9+
include:
10+
- master
11+
12+
variables:
13+
MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository
14+
WEBRTC_CACHE_FOLDER: $(Pipeline.Workspace)/webrtc-build
15+
16+
strategy:
17+
matrix:
18+
linux:
19+
imageName: "ubuntu-latest"
20+
mac:
21+
imageName: "macos-latest"
22+
windows:
23+
imageName: "windows-latest"
24+
25+
pool:
26+
vmImage: $(imageName)
27+
28+
steps:
29+
- task: Bash@3
30+
displayName: "Set up Linux audio system"
31+
condition: eq(variables['Agent.OS'], 'Linux')
32+
inputs:
33+
targetType: "inline"
34+
script: |
35+
sudo apt-get install -y pulseaudio
36+
pulseaudio --start
37+
38+
- task: Bash@3
39+
displayName: "Set up GPG"
40+
inputs:
41+
targetType: "inline"
42+
script: gpg --import --no-tty --batch "$(gpgKey.secureFilePath)"
43+
44+
- task: DownloadSecureFile@1
45+
displayName: "Download GPG key"
46+
name: gpgKey
47+
inputs:
48+
secureFile: gpg-key.asc
49+
50+
- task: DownloadSecureFile@1
51+
displayName: "Download Maven settings"
52+
name: mvnSettings
53+
inputs:
54+
secureFile: settings.xml
55+
56+
- task: Cache@2
57+
displayName: "Set up WebRTC cache"
58+
inputs:
59+
key: 'webrtc | 3987 | "$(Agent.OS)" | "$(Agent.OSArchitecture)" | webrtc-jni/pom.xml'
60+
restoreKeys: webrtc | 3987 | "$(Agent.OS)" | "$(Agent.OSArchitecture)"
61+
path: $(WEBRTC_CACHE_FOLDER)
62+
63+
- task: Cache@2
64+
displayName: "Set up Maven cache"
65+
inputs:
66+
key: 'maven | "$(Agent.OS)" | **/pom.xml, !**/target/**'
67+
restoreKeys: |
68+
maven | "$(Agent.OS)"
69+
maven
70+
path: $(MAVEN_CACHE_FOLDER)
71+
72+
- task: Maven@3
73+
displayName: "Build"
74+
env:
75+
LOCAL_REPO: $(MAVEN_CACHE_FOLDER)
76+
WEBRTC_INSTALL_FOLDER: $(WEBRTC_CACHE_FOLDER)
77+
inputs:
78+
jdkVersionOption: "1.11"
79+
publishJUnitResults: false
80+
goals: "package"
81+
options: "-DskipTests -s $(mvnSettings.secureFilePath)"
82+
83+
- task: Maven@3
84+
displayName: "Test"
85+
env:
86+
LOCAL_REPO: $(MAVEN_CACHE_FOLDER)
87+
inputs:
88+
jdkVersionOption: "1.11"
89+
mavenPomFile: 'webrtc/pom.xml'
90+
goals: "jar:jar surefire:test"
91+
options: "-s $(mvnSettings.secureFilePath)"
92+
testRunTitle: "$(Agent.OS) ($(Agent.OSArchitecture))"
93+
94+
- task: Maven@3
95+
displayName: "Deploy"
96+
env:
97+
NEXUS_USERNAME: $(NEXUS_USERNAME)
98+
NEXUS_PASSWORD: $(NEXUS_PASSWORD)
99+
LOCAL_REPO: $(MAVEN_CACHE_FOLDER)
100+
WEBRTC_INSTALL_FOLDER: $(WEBRTC_CACHE_FOLDER)
101+
inputs:
102+
jdkVersionOption: "1.11"
103+
publishJUnitResults: false
104+
goals: "deploy"
105+
options: "-DskipTests -s $(mvnSettings.secureFilePath)"

.azure/release-pipeline.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
trigger:
2+
tags:
3+
include:
4+
- v*
5+
6+
pr: none
7+
8+
variables:
9+
MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository
10+
WEBRTC_CACHE_FOLDER: $(Pipeline.Workspace)/webrtc-build
11+
12+
strategy:
13+
matrix:
14+
linux:
15+
imageName: "ubuntu-latest"
16+
mac:
17+
imageName: "macos-latest"
18+
windows:
19+
imageName: "windows-latest"
20+
21+
pool:
22+
vmImage: $(imageName)
23+
24+
steps:
25+
- task: Bash@3
26+
displayName: "Set up Linux audio system"
27+
condition: eq(variables['Agent.OS'], 'Linux')
28+
inputs:
29+
targetType: "inline"
30+
script: |
31+
sudo apt-get install -y pulseaudio
32+
pulseaudio --start
33+
34+
- task: Bash@3
35+
displayName: "Set up GPG"
36+
inputs:
37+
targetType: "inline"
38+
script: gpg --import --no-tty --batch "$(gpgKey.secureFilePath)"
39+
40+
- task: DownloadSecureFile@1
41+
displayName: "Download GPG key"
42+
name: gpgKey
43+
inputs:
44+
secureFile: gpg-key.asc
45+
46+
- task: DownloadSecureFile@1
47+
displayName: "Download Maven settings"
48+
name: mvnSettings
49+
inputs:
50+
secureFile: settings.xml
51+
52+
- task: Cache@2
53+
displayName: "Set up WebRTC cache"
54+
inputs:
55+
key: 'webrtc | 3987 | "$(Agent.OS)" | "$(Agent.OSArchitecture)" | webrtc-jni/pom.xml'
56+
restoreKeys: webrtc | 3987 | "$(Agent.OS)" | "$(Agent.OSArchitecture)"
57+
path: $(WEBRTC_CACHE_FOLDER)
58+
59+
- task: Cache@2
60+
displayName: "Set up Maven cache"
61+
inputs:
62+
key: 'maven | "$(Agent.OS)" | **/pom.xml, !**/target/**'
63+
restoreKeys: |
64+
maven | "$(Agent.OS)"
65+
maven
66+
path: $(MAVEN_CACHE_FOLDER)
67+
68+
- task: Maven@3
69+
displayName: "Build"
70+
env:
71+
LOCAL_REPO: $(MAVEN_CACHE_FOLDER)
72+
WEBRTC_INSTALL_FOLDER: $(WEBRTC_CACHE_FOLDER)
73+
inputs:
74+
jdkVersionOption: "1.11"
75+
publishJUnitResults: false
76+
goals: "package"
77+
options: "-DskipTests -s $(mvnSettings.secureFilePath)"
78+
79+
- task: Maven@3
80+
displayName: "Test"
81+
env:
82+
LOCAL_REPO: $(MAVEN_CACHE_FOLDER)
83+
inputs:
84+
jdkVersionOption: "1.11"
85+
mavenPomFile: 'webrtc/pom.xml'
86+
goals: "jar:jar surefire:test"
87+
options: "-s $(mvnSettings.secureFilePath)"
88+
testRunTitle: "$(Agent.OS) ($(Agent.OSArchitecture))"
89+
90+
- task: Maven@3
91+
displayName: "Deploy"
92+
env:
93+
GPG_PASSPHRASE: $(GPG_PASSPHRASE)
94+
NEXUS_USERNAME: $(NEXUS_USERNAME)
95+
NEXUS_PASSWORD: $(NEXUS_PASSWORD)
96+
LOCAL_REPO: $(MAVEN_CACHE_FOLDER)
97+
WEBRTC_INSTALL_FOLDER: $(WEBRTC_CACHE_FOLDER)
98+
inputs:
99+
jdkVersionOption: "1.11"
100+
publishJUnitResults: false
101+
goals: "deploy"
102+
options: "-Prelease -DskipTests -s $(mvnSettings.secureFilePath)"
103+
104+
- task: Bash@3
105+
displayName: "Retrieve git tag"
106+
inputs:
107+
targetType: "inline"
108+
script: |
109+
tag=$(git describe --abbrev=0 --tags)
110+
echo "##vso[task.setvariable variable=GIT_TAG]$tag"
111+
112+
- task: GithubRelease@0
113+
displayName: "Attach artifacts to GitHub Release"
114+
inputs:
115+
gitHubConnection: webrtc-java OAuth
116+
assets: "webrtc-demo/webrtc-demo-javafx/target/*-bundle.jar"
117+
action: edit
118+
target: "$(Build.SourceVersion)"
119+
tag: "$(GIT_TAG)"
120+
addChangeLog: true
121+
assetUploadMode: replace

0 commit comments

Comments
 (0)