diff --git a/.azure-pipelines/buildAndPackage.yml b/.azure-pipelines/buildAndPackage.yml index c44f1069b..0092324b9 100644 --- a/.azure-pipelines/buildAndPackage.yml +++ b/.azure-pipelines/buildAndPackage.yml @@ -38,36 +38,36 @@ stages: - job: Build steps: - template: templates/build/checkout-and-credscan.yml - - template: templates/build/install-java.yml + - template: templates/install-java.yml - template: templates/secure-files.yml parameters: stageID: 'build' - template: templates/build/build-and-coverage.yml - template: templates/build/publish-artefacts.yml - - template: templates/alert-failure.yml -- stage: Maven-Preview +- stage: Maven_Preview condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev')) jobs: - - deployment: Maven-Preview + - deployment: Maven_Preview environment: 'MSGraph SDK Development - Java' pool: vmImage: windows-latest strategy: runOnce: deploy: - steps: + steps: + - template: templates/download-artifacts.yml + - template: templates/install-java.yml - template: templates/secure-files.yml - template: templates/copy-and-build.yml parameters: task: 'publishSnapshotPublicationToSonatypeSnapshotRepository' - - template: templates/alert-failure.yml -- stage: Maven-Release-And-Github-Release +- stage: Maven_Release_And_Github_Release dependsOn: [] condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) jobs: - - deployment: Maven-Release + - deployment: Maven_Release environment: 'MSGraph SDK Development - Java' pool: vmImage: windows-latest @@ -75,16 +75,17 @@ stages: runOnce: deploy: steps: + - template: templates/download-artifacts.yml + - template: templates/install-java.yml - template: templates/secure-files.yml parameters: stageID: 'release' - template: templates/copy-and-build.yml parameters: task: 'publishMavenCentralReleasePublicationToSonatypeRepository' - - template: templates/alert-failure.yml - - deployment: Github-Release - dependsOn: Maven-Release + - deployment: Github_Release + dependsOn: Maven_Release environment: 'MSGraph SDK Development - Java' pool: vmImage: windows-latest @@ -92,7 +93,7 @@ stages: runOnce: deploy: steps: + - template: templates/download-artifacts.yml - template: templates/version-and-release.yml parameters: - gitConnection: 'ramsessanchez' - - template: templates/alert-failure.yml + gitConnection: 'microsoftgraphrelease' diff --git a/.azure-pipelines/templates/alert-failure.yml b/.azure-pipelines/templates/alert-failure.yml deleted file mode 100644 index 51f2043d0..000000000 --- a/.azure-pipelines/templates/alert-failure.yml +++ /dev/null @@ -1,10 +0,0 @@ -steps: -- task: YodLabs.O365PostMessage.O365PostMessageBuild.O365PostMessageBuild@0 - displayName: 'Graph Client Tooling pipeline fail notification' - inputs: - addressType: serviceEndpoint - serviceEndpointName: 'microsoftgraph pipeline status' - title: '$(Build.DefinitionName) failure notification' - text: 'This pipeline has failed. View the build details for further information. This is a blocking failure. ' - condition: and(failed(), ne(variables['Build.Reason'], 'Manual')) - enabled: true \ No newline at end of file diff --git a/.azure-pipelines/templates/build/build-and-coverage.yml b/.azure-pipelines/templates/build/build-and-coverage.yml index 9a56fac54..02ce894a2 100644 --- a/.azure-pipelines/templates/build/build-and-coverage.yml +++ b/.azure-pipelines/templates/build/build-and-coverage.yml @@ -1,7 +1,7 @@ steps: - task: Gradle@2 inputs: - gradleWrapperFile: 'gradlew' + gradleWrapperFile: '$(Build.SourcesDirectory)/gradlew' tasks: 'build' publishJUnitResults: true testResultsFiles: '**/TEST-*.xml' diff --git a/.azure-pipelines/templates/build/checkout-and-credscan.yml b/.azure-pipelines/templates/build/checkout-and-credscan.yml index cc5c7c2f5..a6b9c4b9d 100644 --- a/.azure-pipelines/templates/build/checkout-and-credscan.yml +++ b/.azure-pipelines/templates/build/checkout-and-credscan.yml @@ -3,7 +3,7 @@ steps: clean: true fetchDepth: 1 -- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2 +- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@3 displayName: 'Run CredScan' inputs: - debugMode: false \ No newline at end of file + debugMode: false diff --git a/.azure-pipelines/templates/copy-and-build.yml b/.azure-pipelines/templates/copy-and-build.yml index 3617bfeaf..0ae9f5d55 100644 --- a/.azure-pipelines/templates/copy-and-build.yml +++ b/.azure-pipelines/templates/copy-and-build.yml @@ -8,12 +8,12 @@ steps: inputs: SourceFolder: '$(Agent.TempDirectory)' Contents: '**' - TargetFolder: '$(DROP_PATH)/' + TargetFolder: '$(Agent.BuildDirectory)/Drop/' - task: Gradle@2 inputs: - gradleWrapperFile: '$(DROP_PATH)/gradlew' - workingDirectory: '$(DROP_PATH)' + gradleWrapperFile: $(Agent.BuildDirectory)/Drop/gradlew + workingDirectory: '$(Agent.BuildDirectory)/Drop/' 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 new file mode 100644 index 000000000..dfc62df72 --- /dev/null +++ b/.azure-pipelines/templates/download-artifacts.yml @@ -0,0 +1,10 @@ +steps: + - download: none + - task: DownloadPipelineArtifact@2 + inputs: + source: current + artifact: Drop + path: '$(Agent.BuildDirectory)/Drop/' + patterns: | + ** + * \ No newline at end of file diff --git a/.azure-pipelines/templates/build/install-java.yml b/.azure-pipelines/templates/install-java.yml similarity index 100% rename from .azure-pipelines/templates/build/install-java.yml rename to .azure-pipelines/templates/install-java.yml diff --git a/.azure-pipelines/templates/version-and-release.yml b/.azure-pipelines/templates/version-and-release.yml index 4eed424af..78597aeb9 100644 --- a/.azure-pipelines/templates/version-and-release.yml +++ b/.azure-pipelines/templates/version-and-release.yml @@ -7,7 +7,8 @@ steps: - task: PowerShell@2 inputs: filePath: '$(DROP_PATH)/Scripts/getLatestVersion.ps1' - arguments: '-propertiesPath "$(PROPERTIES_PATH)"' + arguments: '-propertiesPath "$(DROP_PATH)/gradle.properties"' + pwsh: true - task: GitHubRelease@1 inputs: