From a95ac24794bae11539da190edcc4268347e651ff Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Wed, 1 Sep 2021 12:55:52 -0700 Subject: [PATCH 01/12] Create build-and-publish.yml --- .github/workflows/build-and-publish.yml | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build-and-publish.yml diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml new file mode 100644 index 000000000..12f6318d1 --- /dev/null +++ b/.github/workflows/build-and-publish.yml @@ -0,0 +1,50 @@ +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Build and Publish + +on: + push: + branches: [ dev , master ] + paths-ignore: + - .gradle/wrapper + - .gitignore + - CONTRIBUTING.md + - LICENSE + - THIRD PARTY NOTICES + - gradle.properties + - gradlew + - gradlew.bat + - readme.md + - settings.gradle + - Scripts/* + +jobs: + build-and-publish: + env: + GRADLE_OPTIONS: -x jar -x javadoc -x javadocJar -x compileJava -x processResources -x classes -x sourceJar + PREVIEW_TASK: publishSnapshotPublicationToSonatypeSnapshotRepository + PUBLISH_TASK: publishMavenCentralReleasePublicationToSonatypeRepository + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '16' + distribution: 'adopt' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Preview + if: ${{ github.ref == 'refs/head/dev' }} + run: ./gradlew $GRADLE_OPTIONS $PREVIEW_TASK + - name: Publish + if: ${{ github.ref === 'refs/head/master' }} + run: ./gradlew $GRADLE_OPTIONS $PUBLISH_TASK From 28e818cf8f08afec7cb9a7f88a7b80b75f5921af Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Thu, 2 Sep 2021 11:08:32 -0700 Subject: [PATCH 02/12] Update .github/workflows/build-and-publish.yml Co-authored-by: Vincent Biret --- .github/workflows/build-and-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 12f6318d1..50863f178 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -33,7 +33,7 @@ jobs: - - name: Set up JDK 11 + - name: Set up JDK uses: actions/setup-java@v2 with: java-version: '16' From b0b2d46008490544154bcae5c9875ca6b7028f88 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Thu, 2 Sep 2021 13:53:44 -0700 Subject: [PATCH 03/12] Update build-and-publish.yml --- .github/workflows/build-and-publish.yml | 123 +++++++++++++++++------- 1 file changed, 88 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 50863f178..eda36d495 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -6,45 +6,98 @@ name: Build and Publish on: push: branches: [ dev , master ] - paths-ignore: - - .gradle/wrapper - - .gitignore - - CONTRIBUTING.md - - LICENSE - - THIRD PARTY NOTICES - - gradle.properties - - gradlew - - gradlew.bat - - readme.md - - settings.gradle - - Scripts/* + paths: + - 'src/*' + - '!.gradle/wrapper' + - '!.gitignore' + - '!LICENSE' + - '!THIRD PARTY NOTICES' + - '!*.md' + - '*.gradle' +env: + GRADLE_OPTIONS: -x jar -x javadoc -x javadocJar -x compileJava -x processResources -x classes -x sourceJar + PREVIEW_TASK: publishSnapshotPublicationToSonatypeSnapshotRepository + PUBLISH_TASK: publishMavenCentralReleasePublicationToSonatypeRepository jobs: - build-and-publish: - env: - GRADLE_OPTIONS: -x jar -x javadoc -x javadocJar -x compileJava -x processResources -x classes -x sourceJar - PREVIEW_TASK: publishSnapshotPublicationToSonatypeSnapshotRepository - PUBLISH_TASK: publishMavenCentralReleasePublicationToSonatypeRepository - + maven_Release: + if: ${{ github.ref == 'ref/head/master' }} + environment: + name: maven_central_release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: '16' + distribution: 'adopt' + cache: gradle + + ##Copy the Step below for the other files with the appropriate values + - run: .\scripts\decodeAndWrite.ps1 -encodedValue $ENCODED_VALUE -outputPath $OUTPUT_PATH + shell: pwsh + env: + ENCODED_VALUE: "" + OUTPUT_PATH: "" + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Publish + run: ./gradlew $PUBLISH_TASK + - name: Upload Build Artifact + uses: actions/upload-artifact@v2.2.4 + with: + name: drop + path: | + **/libs/* + build/generated-pom.xml + build/generated-pom.xml.asc + build.gradle + gradlew + gradlew.bat + settings.gradle + gradle.properties + **/gradle/** + Scripts/** + + githubRelease: + needs: maven_Release runs-on: ubuntu-latest + steps: + - name: Download Build Artifact + uses: actions/download-artifact@v2.0.10 + with: + name: drop + path: drop + - name: GitHub Releases + uses: fnkr/github-action-ghr@v1.3 + env: + GHR_PATH: current/working/directory/drop/ + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + maven_Preview: + if: ${{ github.ref == 'refs/head/dev' }} + environment: + name: maven_central_snapshot + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: '16' + distribution: 'adopt' + cache: gradle + ##Copy the Step below for the other files with the appropriate values + - run: .\scripts\decodeAndWrite.ps1 -encodedValue $ENCODED_VALUE -outputPath $OUTPUT_PATH + shell: pwsh + env: + ENCODED_VALUE: "" + OUTPUT_PATH: "" - - - name: Set up JDK - uses: actions/setup-java@v2 - with: - java-version: '16' - distribution: 'adopt' - cache: gradle - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Preview - if: ${{ github.ref == 'refs/head/dev' }} - run: ./gradlew $GRADLE_OPTIONS $PREVIEW_TASK - - name: Publish - if: ${{ github.ref === 'refs/head/master' }} - run: ./gradlew $GRADLE_OPTIONS $PUBLISH_TASK + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Publish + run: ./gradlew $PREVIEW_TASK From 25012a060cb2ea9fa445b98198cb3808bf52f11a Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Thu, 2 Sep 2021 13:56:45 -0700 Subject: [PATCH 04/12] Update build-and-publish.yml --- .github/workflows/build-and-publish.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index eda36d495..f9f1b2c97 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -15,7 +15,6 @@ on: - '!*.md' - '*.gradle' env: - GRADLE_OPTIONS: -x jar -x javadoc -x javadocJar -x compileJava -x processResources -x classes -x sourceJar PREVIEW_TASK: publishSnapshotPublicationToSonatypeSnapshotRepository PUBLISH_TASK: publishMavenCentralReleasePublicationToSonatypeRepository @@ -27,6 +26,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Easy detect-secrets + uses: RobertFischer/detect-secrets-action@v2.0.0 - name: Set up JDK uses: actions/setup-java@v2 with: @@ -83,6 +84,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Easy detect-secrets + uses: RobertFischer/detect-secrets-action@v2.0.0 - name: Set up JDK uses: actions/setup-java@v2 with: From 0563999d2bf59effd190439e382697eda3d6f537 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Tue, 7 Sep 2021 10:51:34 -0700 Subject: [PATCH 05/12] Update build-and-publish.yml --- .github/workflows/build-and-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index f9f1b2c97..a03277c9f 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -36,7 +36,7 @@ jobs: cache: gradle ##Copy the Step below for the other files with the appropriate values - - run: .\scripts\decodeAndWrite.ps1 -encodedValue $ENCODED_VALUE -outputPath $OUTPUT_PATH + - run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH shell: pwsh env: ENCODED_VALUE: "" From 1cb8ffc7db0a72f7edd128c031e5e13258d5fd63 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Wed, 8 Sep 2021 02:09:18 -0700 Subject: [PATCH 06/12] Update build-and-publish.yml --- .github/workflows/build-and-publish.yml | 67 ++++++++++++------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index a03277c9f..f0388120b 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -19,6 +19,31 @@ env: PUBLISH_TASK: publishMavenCentralReleasePublicationToSonatypeRepository jobs: + maven_Preview: + if: ${{ github.ref == 'refs/head/dev' }} + environment: + name: maven_central_snapshot + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Easy detect-secrets + uses: RobertFischer/detect-secrets-action@v2.0.0 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: '16' + distribution: 'adopt' + cache: gradle + - run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH + shell: pwsh + env: + ENCODED_VALUE: ${{ secrets.LOCAL_PROPERTIES }} + OUTPUT_PATH: .\local.properties + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Publish + run: ./gradlew $PREVIEW_TASK + maven_Release: if: ${{ github.ref == 'ref/head/master' }} environment: @@ -33,15 +58,17 @@ jobs: with: java-version: '16' distribution: 'adopt' - cache: gradle - - ##Copy the Step below for the other files with the appropriate values + cache: gradle - run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH shell: pwsh env: - ENCODED_VALUE: "" - OUTPUT_PATH: "" - + ENCODED_VALUE: ${{ secrets.LOCAL_PROPERTIES }} + OUTPUT_PATH: .\local.properties + - run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH + shell: pwsh + env: + ENCODED_VALUE: ${{ secrets.SECRING_GPG }} + OUTPUT_PATH: .\secring.gpg - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Publish @@ -76,31 +103,3 @@ jobs: env: GHR_PATH: current/working/directory/drop/ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - maven_Preview: - if: ${{ github.ref == 'refs/head/dev' }} - environment: - name: maven_central_snapshot - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Easy detect-secrets - uses: RobertFischer/detect-secrets-action@v2.0.0 - - name: Set up JDK - uses: actions/setup-java@v2 - with: - java-version: '16' - distribution: 'adopt' - cache: gradle - - ##Copy the Step below for the other files with the appropriate values - - run: .\scripts\decodeAndWrite.ps1 -encodedValue $ENCODED_VALUE -outputPath $OUTPUT_PATH - shell: pwsh - env: - ENCODED_VALUE: "" - OUTPUT_PATH: "" - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Publish - run: ./gradlew $PREVIEW_TASK From 581df0f9bdaab790c877f7e8755c86feba507330 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Wed, 8 Sep 2021 02:20:27 -0700 Subject: [PATCH 07/12] Update build-and-publish.yml --- .github/workflows/build-and-publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index f0388120b..d55d1919a 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -7,7 +7,8 @@ on: push: branches: [ dev , master ] paths: - - 'src/*' + - 'src/**' + - '.github/**' - '!.gradle/wrapper' - '!.gitignore' - '!LICENSE' From dd30785b6fc44ea4e41e8eb79ac436d9377af22f Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Thu, 9 Sep 2021 16:03:04 -0700 Subject: [PATCH 08/12] Update build-and-publish.yml --- .github/workflows/build-and-publish.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index d55d1919a..0154c87a8 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -99,8 +99,10 @@ jobs: with: name: drop path: drop - - name: GitHub Releases - uses: fnkr/github-action-ghr@v1.3 + - name: Github Release + uses: elgohr/Github-Release-Action@v3.1 env: - GHR_PATH: current/working/directory/drop/ - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + with: + args: MS-Graph-SDK-Java-Core Release + From 1c89abb289e83333d881348d676beb024a662fd3 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 10 Sep 2021 04:52:40 -0700 Subject: [PATCH 09/12] - removes ADO pipeline definition --- .azure-pipelines/buildAndPackage.yml | 111 ------------------ .../templates/build/build-and-coverage.yml | 16 --- .../templates/build/checkout-and-credscan.yml | 9 -- .../templates/build/publish-artefacts.yml | 22 ---- .azure-pipelines/templates/copy-and-build.yml | 25 ---- .../templates/download-artifacts.yml | 14 --- .azure-pipelines/templates/install-java.yml | 11 -- .azure-pipelines/templates/secure-files.yml | 29 ----- .../templates/version-and-release.yml | 27 ----- 9 files changed, 264 deletions(-) delete mode 100644 .azure-pipelines/buildAndPackage.yml delete mode 100644 .azure-pipelines/templates/build/build-and-coverage.yml delete mode 100644 .azure-pipelines/templates/build/checkout-and-credscan.yml delete mode 100644 .azure-pipelines/templates/build/publish-artefacts.yml delete mode 100644 .azure-pipelines/templates/copy-and-build.yml delete mode 100644 .azure-pipelines/templates/download-artifacts.yml delete mode 100644 .azure-pipelines/templates/install-java.yml delete mode 100644 .azure-pipelines/templates/secure-files.yml delete mode 100644 .azure-pipelines/templates/version-and-release.yml diff --git a/.azure-pipelines/buildAndPackage.yml b/.azure-pipelines/buildAndPackage.yml deleted file mode 100644 index 7b0f89d28..000000000 --- a/.azure-pipelines/buildAndPackage.yml +++ /dev/null @@ -1,111 +0,0 @@ -#Copyright (c) Microsoft Corporation. All rights reserved. -#Licensed under the MIT License. -#Building and packaging the artifacts of the Java-Core libraries using the build.gradle file. -#Ready the package for deployment and release. - -trigger: - branches: - include: - - dev - - main - - master - paths: - include: - - src/* - exclude: - - .gradle/wrapper - - .gitignore - - CONTRIBUTING.md - - LICENSE - - THIRD PARTY NOTICES - - gradle.properties - - gradlew - - gradlew.bat - - readme.md - - settings.gradle - - Scripts/* - -pr: -- dev -- master - -pool: - vmImage: windows-latest - -variables: - DROP_PATH: '$(Agent.BuildDirectory)/Drop' - -stages: -- stage: Build - jobs: - - job: Build - steps: - - template: templates/build/checkout-and-credscan.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 - -- stage: Maven_Preview - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev')) - jobs: - - deployment: Maven_Preview - environment: 'MSGraph SDK Development - Java' - pool: - vmImage: windows-latest - strategy: - runOnce: - 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: Build - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - jobs: - - deployment: Maven_Release - environment: 'MSGraph SDK Development - Java' - pool: - vmImage: windows-latest - strategy: - runOnce: - deploy: - steps: - - template: templates/download-artifacts.yml - parameters: - directoryPath: $(DROP_PATH) - - template: templates/install-java.yml - - template: templates/secure-files.yml - parameters: - stageID: 'release' - - template: templates/copy-and-build.yml - parameters: - task: 'publishMavenCentralReleasePublicationToSonatypeRepository' - directoryPath: $(DROP_PATH) - - - deployment: Github_Release - dependsOn: Maven_Release - environment: 'MSGraph SDK Development - Java' - pool: - vmImage: windows-latest - strategy: - runOnce: - 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/build/build-and-coverage.yml b/.azure-pipelines/templates/build/build-and-coverage.yml deleted file mode 100644 index 02ce894a2..000000000 --- a/.azure-pipelines/templates/build/build-and-coverage.yml +++ /dev/null @@ -1,16 +0,0 @@ -steps: -- task: Gradle@2 - inputs: - gradleWrapperFile: '$(Build.SourcesDirectory)/gradlew' - tasks: 'build' - publishJUnitResults: true - testResultsFiles: '**/TEST-*.xml' - javaHomeOption: 'JDKVersion' - sonarQubeRunAnalysis: false - -- task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: 'JaCoCo' - summaryFileLocation: $(System.DefaultWorkingDirectory)/build/reports/jacoco/test/jacocoTestReport.xml - pathToSources: $(System.DefaultWorkingDirectory)/src/main/java - failIfCoverageEmpty: true \ No newline at end of file diff --git a/.azure-pipelines/templates/build/checkout-and-credscan.yml b/.azure-pipelines/templates/build/checkout-and-credscan.yml deleted file mode 100644 index a6b9c4b9d..000000000 --- a/.azure-pipelines/templates/build/checkout-and-credscan.yml +++ /dev/null @@ -1,9 +0,0 @@ -steps: -- checkout: self - clean: true - fetchDepth: 1 - -- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@3 - displayName: 'Run CredScan' - inputs: - debugMode: false diff --git a/.azure-pipelines/templates/build/publish-artefacts.yml b/.azure-pipelines/templates/build/publish-artefacts.yml deleted file mode 100644 index 5c67587a8..000000000 --- a/.azure-pipelines/templates/build/publish-artefacts.yml +++ /dev/null @@ -1,22 +0,0 @@ -steps: -- task: CopyFiles@2 - condition: ne(variables['Build.Reason'], 'PullRequest') - inputs: - SourceFolder: '$(System.DefaultWorkingDirectory)' - Contents: | - **/libs/* - build/generated-pom.xml - build/generated-pom.xml.asc - build.gradle - gradlew - gradlew.bat - settings.gradle - gradle.properties - **/gradle/** - Scripts/** - TargetFolder: '$(Build.ArtifactStagingDirectory)/' - -- publish: $(Build.ArtifactStagingDirectory) - condition: ne(variables['Build.Reason'], 'PullRequest') - artifact: Drop - displayName: Publish Build Artifact diff --git a/.azure-pipelines/templates/copy-and-build.yml b/.azure-pipelines/templates/copy-and-build.yml deleted file mode 100644 index 787fe1a6f..000000000 --- a/.azure-pipelines/templates/copy-and-build.yml +++ /dev/null @@ -1,25 +0,0 @@ -parameters: -- name: task - type: string - default: '' -- name: directoryPath - type: string - -steps: -- task: CopyFiles@2 - inputs: - SourceFolder: '$(Agent.TempDirectory)' - Contents: '**' - TargetFolder: '${{ parameters.directoryPath }}/' - -- task: Gradle@2 - inputs: - 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 - testResultsFiles: '**/TEST-*.xml' - javaHomeOption: 'JDKVersion' - sonarQubeRunAnalysis: false - spotBugsAnalysis: false diff --git a/.azure-pipelines/templates/download-artifacts.yml b/.azure-pipelines/templates/download-artifacts.yml deleted file mode 100644 index ecd6d7d9e..000000000 --- a/.azure-pipelines/templates/download-artifacts.yml +++ /dev/null @@ -1,14 +0,0 @@ -parameters: -- name: directoryPath - type: string - -steps: - - download: none - - task: DownloadPipelineArtifact@2 - inputs: - source: current - artifact: Drop - path: '${{ parameters.directoryPath }}/' - patterns: | - ** - * diff --git a/.azure-pipelines/templates/install-java.yml b/.azure-pipelines/templates/install-java.yml deleted file mode 100644 index 82e866466..000000000 --- a/.azure-pipelines/templates/install-java.yml +++ /dev/null @@ -1,11 +0,0 @@ -steps: -- 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' - displayName: 'Download JDK' - -- task: JavaToolInstaller@0 - inputs: - versionSpec: '16' - jdkArchitectureOption: 'x64' - jdkSourceOption: 'LocalDirectory' - jdkFile: 'OpenJDK.zip' - jdkDestinationDirectory: 'binaries' \ No newline at end of file diff --git a/.azure-pipelines/templates/secure-files.yml b/.azure-pipelines/templates/secure-files.yml deleted file mode 100644 index 01086fc53..000000000 --- a/.azure-pipelines/templates/secure-files.yml +++ /dev/null @@ -1,29 +0,0 @@ -parameters: -- name: stageID - type: string - default: '' - -steps: -- task: DownloadSecureFile@1 - inputs: - secureFile: 'local.properties' - retryCount: '5' - -- ${{ if or(eq(parameters.stageID, 'build'), eq(parameters.stageID, 'release')) }}: - - task: DownloadSecureFile@1 - inputs: - secureFile: 'secring.gpg' - retryCount: '5' - - - task: DownloadSecureFile@1 - inputs: - secureFile: 'secring.gpg.lock' - retryCount: '5' - -- ${{ if eq(parameters.stageID, 'build') }}: - - task: CopyFiles@2 - inputs: - SourceFolder: '$(Agent.TempDirectory)' - Contents: '**' - TargetFolder: '$(System.DefaultWorkingDirectory)' - diff --git a/.azure-pipelines/templates/version-and-release.yml b/.azure-pipelines/templates/version-and-release.yml deleted file mode 100644 index 92eb32359..000000000 --- a/.azure-pipelines/templates/version-and-release.yml +++ /dev/null @@ -1,27 +0,0 @@ -parameters: -- name: gitConnection - type: string - default: '' -- name: directoryPath - type: string - -steps: -- task: PowerShell@2 - inputs: - filePath: '${{ parameters.directoryPath }}/Scripts/getLatestVersion.ps1' - arguments: '-propertiesPath "${{ parameters.directoryPath }}/gradle.properties"' - pwsh: true - -- task: GitHubRelease@1 - inputs: - gitHubConnection: ${{ parameters.gitConnection }} - repositoryName: '$(Build.Repository.Name)' - action: 'create' - target: '$(Build.SourceVersion)' - tagSource: 'userSpecifiedTag' - tag: '$(VERSION_STRING)' - assets: | - !**/** - $(Build.ArtifactStagingDirectory)/* - changeLogCompareToRelease: 'lastFullRelease' - changeLogType: 'commitBased' From 8b7a854d266b590827f5a7fb73122ac859a4e27d Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Mon, 13 Sep 2021 09:57:42 -0700 Subject: [PATCH 10/12] add working release action and upload changelog.md --- .github/workflows/build-and-publish.yml | 12 ++++++++---- CHANGELOG.MD | 11 +++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 CHANGELOG.MD diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 0154c87a8..be4506c1e 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -100,9 +100,13 @@ jobs: name: drop path: drop - name: Github Release - uses: elgohr/Github-Release-Action@v3.1 + uses: anton-yurchenko/git-release@v4.1 env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} + DRAFT_RELEASE: "false" + PRE_RELEASE: "false" + CHANGELOG_FILE: "CHANGELOG.md" + ALLOW_EMPTY_CHANGELOG: "true" with: - args: MS-Graph-SDK-Java-Core Release - + args: | + current/working/directory/drop/** diff --git a/CHANGELOG.MD b/CHANGELOG.MD new file mode 100644 index 000000000..c391cb12f --- /dev/null +++ b/CHANGELOG.MD @@ -0,0 +1,11 @@ +#Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +##[Unreleased] +###Added +###Changed +##[x.x.x] - 2021-09-14 \ No newline at end of file From 046b6da7f7d829a3191255f7002595f7573c2a0c Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Mon, 13 Sep 2021 10:50:00 -0700 Subject: [PATCH 11/12] Update .github/workflows/build-and-publish.yml Co-authored-by: Vincent Biret --- .github/workflows/build-and-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index be4506c1e..5257a4100 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -109,4 +109,4 @@ jobs: ALLOW_EMPTY_CHANGELOG: "true" with: args: | - current/working/directory/drop/** + drop/** From 0b989757ec06832b0b1ce1eb052bd29c03eb53bc Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Mon, 13 Sep 2021 10:51:24 -0700 Subject: [PATCH 12/12] Update .github/workflows/build-and-publish.yml Co-authored-by: Vincent Biret --- .github/workflows/build-and-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 5257a4100..fc73eb9be 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -94,6 +94,7 @@ jobs: needs: maven_Release runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 - name: Download Build Artifact uses: actions/download-artifact@v2.0.10 with: