Skip to content

Commit 9a9f515

Browse files
authored
Merge pull request #290 from microsoftgraph/dev
pipelines updates
2 parents 57df2dd + b99f216 commit 9a9f515

File tree

8 files changed

+39
-16
lines changed

8 files changed

+39
-16
lines changed

.azure-pipelines/buildAndPackage.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ pr:
3232
pool:
3333
vmImage: windows-latest
3434

35+
variables:
36+
DROP_PATH: '$(Agent.BuildDirectory)/Drop'
37+
3538
stages:
3639
- stage: Build
3740
jobs:
@@ -57,14 +60,17 @@ stages:
5760
deploy:
5861
steps:
5962
- template: templates/download-artifacts.yml
63+
parameters:
64+
directoryPath: $(DROP_PATH)
6065
- template: templates/install-java.yml
6166
- template: templates/secure-files.yml
6267
- template: templates/copy-and-build.yml
6368
parameters:
6469
task: 'publishSnapshotPublicationToSonatypeSnapshotRepository'
70+
directoryPath: $(DROP_PATH)
6571

6672
- stage: Maven_Release_And_Github_Release
67-
dependsOn: []
73+
dependsOn: Build
6874
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
6975
jobs:
7076
- deployment: Maven_Release
@@ -76,13 +82,16 @@ stages:
7682
deploy:
7783
steps:
7884
- template: templates/download-artifacts.yml
85+
parameters:
86+
directoryPath: $(DROP_PATH)
7987
- template: templates/install-java.yml
8088
- template: templates/secure-files.yml
8189
parameters:
8290
stageID: 'release'
8391
- template: templates/copy-and-build.yml
8492
parameters:
8593
task: 'publishMavenCentralReleasePublicationToSonatypeRepository'
94+
directoryPath: $(DROP_PATH)
8695

8796
- deployment: Github_Release
8897
dependsOn: Maven_Release
@@ -94,6 +103,9 @@ stages:
94103
deploy:
95104
steps:
96105
- template: templates/download-artifacts.yml
106+
parameters:
107+
directoryPath: $(DROP_PATH)
97108
- template: templates/version-and-release.yml
98109
parameters:
99110
gitConnection: 'microsoftgraphrelease'
111+
directoryPath: $(DROP_PATH)

.azure-pipelines/templates/build/publish-artefacts.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
steps:
22
- task: CopyFiles@2
3+
condition: ne(variables['Build.Reason'], 'PullRequest')
34
inputs:
45
SourceFolder: '$(System.DefaultWorkingDirectory)'
56
Contents: |
@@ -16,5 +17,6 @@ steps:
1617
TargetFolder: '$(Build.ArtifactStagingDirectory)/'
1718

1819
- publish: $(Build.ArtifactStagingDirectory)
20+
condition: ne(variables['Build.Reason'], 'PullRequest')
1921
artifact: Drop
2022
displayName: Publish Build Artifact

.azure-pipelines/templates/copy-and-build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@ parameters:
22
- name: task
33
type: string
44
default: ''
5+
- name: directoryPath
6+
type: string
57

68
steps:
79
- task: CopyFiles@2
810
inputs:
911
SourceFolder: '$(Agent.TempDirectory)'
1012
Contents: '**'
11-
TargetFolder: '$(Agent.BuildDirectory)/Drop/'
13+
TargetFolder: '${{ parameters.directoryPath }}/'
1214

1315
- task: Gradle@2
1416
inputs:
15-
gradleWrapperFile: $(Agent.BuildDirectory)/Drop/gradlew
16-
workingDirectory: '$(Agent.BuildDirectory)/Drop/'
17+
gradleWrapperFile: ${{ parameters.directoryPath }}/gradlew
18+
workingDirectory: '${{ parameters.directoryPath }}/'
1719
options: '-x jar -x javadoc -x javadocJar -x compileJava -x processResources -x classes -x sourceJar'
1820
tasks: ${{ parameters.task }}
1921
publishJUnitResults: true
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
parameters:
2+
- name: directoryPath
3+
type: string
4+
15
steps:
26
- download: none
37
- task: DownloadPipelineArtifact@2
48
inputs:
59
source: current
610
artifact: Drop
7-
path: '$(Agent.BuildDirectory)/Drop/'
11+
path: '${{ parameters.directoryPath }}/'
812
patterns: |
913
**
10-
*
14+
*

.azure-pipelines/templates/version-and-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ parameters:
22
- name: gitConnection
33
type: string
44
default: ''
5+
- name: directoryPath
6+
type: string
57

68
steps:
79
- task: PowerShell@2
810
inputs:
9-
filePath: '$(DROP_PATH)/Scripts/getLatestVersion.ps1'
10-
arguments: '-propertiesPath "$(DROP_PATH)/gradle.properties"'
11+
filePath: '${{ parameters.directoryPath }}/Scripts/getLatestVersion.ps1'
12+
arguments: '-propertiesPath "${{ parameters.directoryPath }}/gradle.properties"'
1113
pwsh: true
1214

1315
- task: GitHubRelease@1

gradle/dependencies.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ dependencies {
22
// Use JUnit test framework
33
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
44
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
5-
testImplementation 'org.mockito:mockito-inline:3.11.2'
5+
testImplementation 'org.mockito:mockito-inline:3.12.3'
66

77
api 'com.squareup.okhttp3:okhttp:4.9.1'
88

99
implementation 'com.google.guava:guava:30.1.1-jre'
1010

11-
implementation 'com.google.code.gson:gson:2.8.7'
11+
implementation 'com.google.code.gson:gson:2.8.8'
1212
api 'com.azure:azure-core:1.19.0'
1313
}

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<dependency>
2121
<groupId>com.google.code.gson</groupId>
2222
<artifactId>gson</artifactId>
23-
<version>2.8.7</version>
23+
<version>2.8.8</version>
2424
</dependency>
2525
<dependency>
2626
<groupId>com.google.guava</groupId>
@@ -46,7 +46,7 @@
4646
<dependency>
4747
<groupId>org.mockito</groupId>
4848
<artifactId>mockito-inline</artifactId>
49-
<version>3.11.2</version>
49+
<version>3.12.3</version>
5050
<scope>test</scope>
5151
</dependency>
5252
</dependencies>

scripts/getLatestVersion.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ $file = get-item $propertiesPath
2323
$findVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2
2424
$findVersions = $findVersions -split "`r`n"
2525

26-
$majorVersion = $findVersions[0].Substring($findVersions[0].Length-1)
27-
$minorVersion = $findVersions[1].Substring($findVersions[1].Length-1)
28-
$patchVersion = $findVersions[2].Substring($findVersions[2].Length-1)
26+
$versionIndex = $findVersions[0].IndexOf("=")
27+
$majorVersion = $findVersions[0].Substring($versionIndex+2)
28+
$minorVersion = $findVersions[1].Substring($versionIndex+2)
29+
$patchVersion = $findVersions[2].Substring($versionIndex+2)
2930
$version = "$majorVersion.$minorVersion.$patchVersion"
3031

3132
#Update the VERSION_STRING env variable and inform the user
3233
Write-Host "##vso[task.setVariable variable=VERSION_STRING]$($version)";
33-
Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"
34+
Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"

0 commit comments

Comments
 (0)