Skip to content

Commit 6486a9f

Browse files
committed
maven preview and github release stages. Maven release omitted
1 parent 10bf791 commit 6486a9f

File tree

9 files changed

+109
-15
lines changed

9 files changed

+109
-15
lines changed
Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,50 @@
11
trigger:
22
branches:
33
include:
4-
- dev
5-
- main
4+
- dev
65

7-
pr: none
6+
pr:
7+
- dev
88

99
pool:
10-
vmImage: ubuntu-latest
10+
vmImage: windows-latest
1111

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-
12+
stages:
13+
- stage: Build
14+
jobs:
15+
- job:
16+
steps:
17+
- template: templates/build/checkout-and-credscan.yml
18+
- template: templates/build/install-java.yml
19+
- template: templates/build/secure-files.yml
20+
- template: templates/build/build-and-coverage.yml
21+
- template: templates/build/publish-artifacts.yml
22+
- template: templates/alert-failure.yml
23+
24+
- stage: Maven-Preview-And-Github-Release
25+
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
26+
jobs:
27+
- deployment: Maven-Preview
28+
enviornment: 'MSGraph SDK Development - Java'
29+
pool:
30+
vmImage: windows-latest
31+
strategy:
32+
runOnce:
33+
deploy:
34+
steps:
35+
- template: templates/maven-preview/secure-files.yml
36+
- template: templates/maven-preview/copy-and-build.yml
37+
- template: templates/alert-failure.yml
38+
39+
- deployment: Github-Release
40+
dependsOn: Maven-Preview
41+
enviornment: 'MsGraph SDK Development - Java'
42+
pool:
43+
vmImage: windows-latest
44+
strategy:
45+
runOnce:
46+
deploy:
47+
steps:
48+
- template: templates/github-release/version-and-release.yml
49+
- template: templates/alert-failure.yml
1850

File renamed without changes.
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: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ 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
21+
File renamed without changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
steps:
2+
- task: PowerShell@2
3+
inputs:
4+
filePath: '$(System.DefaultWorkingDirectory)/_msgraph-sdk-java build and packaging/drop/Scripts/getLatestVersion.ps1'
5+
arguments: '-propertiesPath "$(PROPERTIES_PATH)"'
6+
7+
- task: GitHubRelease@1
8+
inputs:
9+
gitHubConnection: 'ramsessanchez'
10+
repositoryName: '$(Build.Repository.Name)'
11+
action: 'create'
12+
target: '$(Build.SourceVersion)'
13+
tagSource: 'userSpecifiedTag'
14+
tag: '$(VERSION_STRING)-$(Build.BuildNumber)'
15+
assets: |
16+
!**/**
17+
$(Build.ArtifactStagingDirectory)/*
18+
isPreRelease: true
19+
changeLogCompareToRelease: 'lastFullRelease'
20+
changeLogType: 'commitBased'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
steps:
2+
- task: CopyFiles@2
3+
inputs:
4+
SourceFolder: '$(Agent.TempDirectory)'
5+
Contents: '**'
6+
TargetFolder: '$(System.DefaultWorkingDirectory)/_msgraph-sdk-java build and packaging/drop/'
7+
8+
- task: Gradle@2
9+
inputs:
10+
gradleWrapperFile: '$(System.DefaultWorkingDirectory)/_msgraph-sdk-java build and packaging/drop/gradlew'
11+
workingDirectory: '$(System.DefaultWorkingDirectory)/_msgraph-sdk-java build and packaging/drop/'
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
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
steps:
2+
- task: DownloadSecureFile@1
3+
inputs:
4+
secureFile: local.properties
5+
retryCount: 5

0 commit comments

Comments
 (0)