Skip to content

Commit 7a151a9

Browse files
Merge pull request #143 from microsoftgraph/rsh/pipelineUpdates
Rsh/pipeline updates
2 parents 10bf791 + 889d313 commit 7a151a9

File tree

8 files changed

+153
-32
lines changed

8 files changed

+153
-32
lines changed
Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,73 @@
1+
#Copyright (c) Microsoft Corporation. All rights reserved.
2+
#Licensed under the MIT License.
3+
#Building and packaging the artifacts of the Java-SDK-Beta libraries using the build.gradle file.
4+
#Ready the package for deployment and release.
5+
16
trigger:
27
branches:
38
include:
4-
- dev
5-
- main
9+
- dev
10+
paths:
11+
include:
12+
- src/*
13+
exclude:
14+
- .gradle/wrapper
15+
- .gitignore
16+
- CONTRIBUTING.md
17+
- LICENSE
18+
- THIRD PARTY NOTICES
19+
- gradle.properties
20+
- gradlew
21+
- gradlew.bat
22+
- readme.md
23+
- settings.gradle
24+
- Scripts/*
625

7-
pr: none
26+
pr:
27+
- dev
828

929
pool:
10-
vmImage: ubuntu-latest
30+
vmImage: windows-latest
1131

12-
steps:
13-
- template: templates/secure-files.yml
14-
- template: templates/build-and-coverage.yml
15-
- template: templates/publish-artifacts.yml
16-
- template: templates/alert-failure.yml
17-
18-
32+
stages:
33+
- stage: Build
34+
jobs:
35+
- job:
36+
steps:
37+
- template: templates/build/checkout-and-credscan.yml
38+
- template: templates/build/install-java.yml
39+
- template: templates/secure-files.yml
40+
parameters:
41+
stageID: 'build'
42+
- template: templates/build/build-and-coverage.yml
43+
- template: templates/build/publish-artifacts.yml
44+
- template: templates/alert-failure.yml
45+
46+
- stage: Maven-Preview-And-Github-Release
47+
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
48+
jobs:
49+
- deployment: Maven-Preview
50+
environment: 'MSGraph SDK Development - Java'
51+
pool:
52+
vmImage: windows-latest
53+
strategy:
54+
runOnce:
55+
deploy:
56+
steps:
57+
- template: templates/secure-files.yml
58+
- template: templates/copy-and-build.yml
59+
- template: templates/alert-failure.yml
60+
61+
- deployment: Github-Release
62+
dependsOn: Maven-Preview
63+
environment: 'MsGraph SDK Development - Java'
64+
pool:
65+
vmImage: windows-latest
66+
strategy:
67+
runOnce:
68+
deploy:
69+
steps:
70+
- template: templates/version-and-release.yml
71+
parameters:
72+
gitConnection: 'ramsessanchez'
73+
- template: templates/alert-failure.yml

.azure-pipelines/templates/build-and-coverage.yml renamed to .azure-pipelines/templates/build/build-and-coverage.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ steps:
66
publishJUnitResults: true
77
testResultsFiles: '**/TEST-*.xml'
88
javaHomeOption: 'JDKVersion'
9-
sonarQubeRunAnalysis: false
10-
11-
9+
sonarQubeRunAnalysis: false
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
steps:
2+
- checkout: self
3+
clean: true
4+
fetchDepth: 1
5+
6+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
7+
displayName: 'Run CredScan'
8+
inputs:
9+
debugMode: false
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
steps:
2+
- pwsh: 'Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk16-binaries/releases/download/jdk-16%2B36/OpenJDK16-jdk_x64_windows_hotspot_16_36.zip -OutFile OpenJDK.zip'
3+
displayName: 'Download JDK'
4+
5+
- task: JavaToolInstaller@0
6+
inputs:
7+
versionSpec: '16'
8+
jdkArchitectureOption: 'x64'
9+
jdkSourceOption: 'LocalDirectory'
10+
jdkFile: 'OpenJDK.zip'
11+
jdkDestinationDirectory: 'binaries'

.azure-pipelines/templates/publish-artifacts.yml renamed to .azure-pipelines/templates/build/publish-artifacts.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ steps:
1515
Scripts/getLatestVersion.ps1
1616
TargetFolder: '$(build.artifactstagingdirectory)/'
1717

18-
- task: PublishBuildArtifacts@1
19-
inputs:
20-
PathtoPublish: '$(build.artifactstagingdirectory)'
21-
ArtifactName: 'drop'
22-
publishLocation: 'Container'
18+
- publish: $(Build.ArtifactStagingDirectory)
19+
artifact: Drop
20+
displayName: Publish Build Artifact
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
steps:
2+
- task: CopyFiles@2
3+
inputs:
4+
SourceFolder: '$(Agent.TempDirectory)'
5+
Contents: '**'
6+
TargetFolder: '$(DROP_PATH)/'
7+
8+
- task: Gradle@2
9+
inputs:
10+
gradleWrapperFile: '$(DROP_PATH)/gradlew'
11+
workingDirectory: '$(DROP_PATH)/'
12+
options: '-x jar -x javadoc -x javadocJar -x compileJava -x processResources -x classes -x sourceJar'
13+
tasks: 'publishSnapshotPublicationToSonatypeSnapshotRepository'
14+
publishJUnitResults: true
15+
testResultsFiles: '**/TEST-*.xml'
16+
javaHomeOption: 'JDKVersion'
17+
sonarQubeRunAnalysis: false
18+
spotBugsAnalysis: false
19+
Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1+
parameters:
2+
- name: stageID
3+
type: string
4+
default: ''
5+
16
steps:
27
- task: DownloadSecureFile@1
38
inputs:
49
secureFile: 'local.properties'
510
retryCount: '5'
611

7-
- task: DownloadSecureFile@1
8-
inputs:
9-
secureFile: 'secring.gpg'
10-
retryCount: '5'
12+
- ${{ if eq(parameters.stageID, 'build') }}:
13+
- task: DownloadSecureFile@1
14+
inputs:
15+
secureFile: 'secring.gpg'
16+
retryCount: '5'
1117

12-
- task: DownloadSecureFile@1
13-
inputs:
14-
secureFile: 'secring.gpg.lock'
15-
retryCount: '5'
18+
- task: DownloadSecureFile@1
19+
inputs:
20+
secureFile: 'secring.gpg.lock'
21+
retryCount: '5'
1622

17-
- task: CopyFiles@2
18-
inputs:
19-
SourceFolder: '$(Agent.TempDirectory)'
20-
Contents: '**'
21-
TargetFolder: '$(system.defaultworkingdirectory)'
23+
- task: CopyFiles@2
24+
inputs:
25+
SourceFolder: '$(Agent.TempDirectory)'
26+
Contents: '**'
27+
TargetFolder: '$(system.defaultworkingdirectory)'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
parameters:
2+
- name: gitConnection
3+
type: string
4+
default: ''
5+
6+
steps:
7+
- task: PowerShell@2
8+
inputs:
9+
filePath: '$(DROP_PATH)/Scripts/getLatestVersion.ps1'
10+
arguments: '-propertiesPath "$(PROPERTIES_PATH)"'
11+
12+
- task: GitHubRelease@1
13+
inputs:
14+
gitHubConnection: ${{ parameters.gitConnection }}
15+
repositoryName: '$(Build.Repository.Name)'
16+
action: 'create'
17+
target: '$(Build.SourceVersion)'
18+
tagSource: 'userSpecifiedTag'
19+
tag: '$(VERSION_STRING)-$(Build.BuildNumber)'
20+
assets: |
21+
!**/**
22+
$(Build.ArtifactStagingDirectory)/*
23+
isPreRelease: true
24+
changeLogCompareToRelease: 'lastFullRelease'
25+
changeLogType: 'commitBased'

0 commit comments

Comments
 (0)