diff --git a/.azure-pipelines/buildAndPackage.yml b/.azure-pipelines/buildAndPackage.yml index 0092324b9..8745de1ae 100644 --- a/.azure-pipelines/buildAndPackage.yml +++ b/.azure-pipelines/buildAndPackage.yml @@ -32,6 +32,9 @@ pr: pool: vmImage: windows-latest +variables: + DROP_PATH: '$(Agent.BuildDirectory)/Drop' + stages: - stage: Build jobs: @@ -57,11 +60,14 @@ stages: deploy: steps: - template: templates/download-artifacts.yml + parameters: + directoryPath: $(DROP_PATH) - template: templates/install-java.yml - template: templates/secure-files.yml - template: templates/copy-and-build.yml parameters: task: 'publishSnapshotPublicationToSonatypeSnapshotRepository' + directoryPath: $(DROP_PATH) - stage: Maven_Release_And_Github_Release dependsOn: [] @@ -76,6 +82,8 @@ stages: deploy: steps: - template: templates/download-artifacts.yml + parameters: + directoryPath: $(DROP_PATH) - template: templates/install-java.yml - template: templates/secure-files.yml parameters: @@ -83,6 +91,7 @@ stages: - template: templates/copy-and-build.yml parameters: task: 'publishMavenCentralReleasePublicationToSonatypeRepository' + directoryPath: $(DROP_PATH) - deployment: Github_Release dependsOn: Maven_Release @@ -94,6 +103,9 @@ stages: deploy: steps: - template: templates/download-artifacts.yml + parameters: + directoryPath: $(DROP_PATH) - template: templates/version-and-release.yml parameters: gitConnection: 'microsoftgraphrelease' + directoryPath: $(DROP_PATH) diff --git a/.azure-pipelines/templates/copy-and-build.yml b/.azure-pipelines/templates/copy-and-build.yml index 0ae9f5d55..787fe1a6f 100644 --- a/.azure-pipelines/templates/copy-and-build.yml +++ b/.azure-pipelines/templates/copy-and-build.yml @@ -2,18 +2,20 @@ parameters: - name: task type: string default: '' +- name: directoryPath + type: string steps: - task: CopyFiles@2 inputs: SourceFolder: '$(Agent.TempDirectory)' Contents: '**' - TargetFolder: '$(Agent.BuildDirectory)/Drop/' + TargetFolder: '${{ parameters.directoryPath }}/' - task: Gradle@2 inputs: - gradleWrapperFile: $(Agent.BuildDirectory)/Drop/gradlew - workingDirectory: '$(Agent.BuildDirectory)/Drop/' + gradleWrapperFile: ${{ parameters.directoryPath }}/gradlew + workingDirectory: '${{ parameters.directoryPath }}/' options: '-x jar -x javadoc -x javadocJar -x compileJava -x processResources -x classes -x sourceJar' tasks: ${{ parameters.task }} publishJUnitResults: true diff --git a/.azure-pipelines/templates/download-artifacts.yml b/.azure-pipelines/templates/download-artifacts.yml index dfc62df72..ecd6d7d9e 100644 --- a/.azure-pipelines/templates/download-artifacts.yml +++ b/.azure-pipelines/templates/download-artifacts.yml @@ -1,10 +1,14 @@ +parameters: +- name: directoryPath + type: string + steps: - download: none - task: DownloadPipelineArtifact@2 inputs: source: current artifact: Drop - path: '$(Agent.BuildDirectory)/Drop/' + path: '${{ parameters.directoryPath }}/' patterns: | ** - * \ No newline at end of file + * diff --git a/.azure-pipelines/templates/version-and-release.yml b/.azure-pipelines/templates/version-and-release.yml index 78597aeb9..92eb32359 100644 --- a/.azure-pipelines/templates/version-and-release.yml +++ b/.azure-pipelines/templates/version-and-release.yml @@ -2,12 +2,14 @@ parameters: - name: gitConnection type: string default: '' +- name: directoryPath + type: string steps: - task: PowerShell@2 inputs: - filePath: '$(DROP_PATH)/Scripts/getLatestVersion.ps1' - arguments: '-propertiesPath "$(DROP_PATH)/gradle.properties"' + filePath: '${{ parameters.directoryPath }}/Scripts/getLatestVersion.ps1' + arguments: '-propertiesPath "${{ parameters.directoryPath }}/gradle.properties"' pwsh: true - task: GitHubRelease@1