Merge pull request #1239 from commercetools/BMU-2448_release_notes #111
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CD | |
| on: | |
| push: | |
| tags: | |
| - '*.*.*' | |
| jobs: | |
| benchmark_tests: | |
| name: benchmark tests | |
| concurrency: benchmark_tests | |
| runs-on: ubuntu-latest | |
| env: | |
| SOURCE_PROJECT_KEY: java-sync-target-dev2 | |
| SOURCE_CLIENT_ID: ${{ secrets.TARGET_CLIENT_ID_2 }} | |
| SOURCE_CLIENT_SECRET: ${{ secrets.TARGET_CLIENT_SECRET_2 }} | |
| TARGET_PROJECT_KEY: java-sync-target-dev2 | |
| TARGET_CLIENT_ID: ${{ secrets.TARGET_CLIENT_ID_2 }} | |
| TARGET_CLIENT_SECRET: ${{ secrets.TARGET_CLIENT_SECRET_2 }} | |
| GRGIT_USER: ${{ secrets.GRGIT_USER }} | |
| SUBMIT_BENCHMARK_RESULT: true | |
| steps: | |
| - name: Git Checkout | |
| uses: actions/checkout@v4 | |
| - name: Fetch Library version | |
| id: vars | |
| run: echo libVersion=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT | |
| - name: benchmark test | |
| if: ${{ success() }} | |
| run: ./gradlew clean setLibraryVersion benchmark | |
| env: | |
| GITHUB_TAG: ${{ steps.vars.outputs.libVersion }} | |
| deployment: | |
| name: deployment | |
| needs: benchmark_tests | |
| runs-on: ubuntu-latest | |
| env: | |
| GRGIT_USER: ${{ secrets.GRGIT_USER }} | |
| steps: | |
| - name: Git Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set output | |
| id: vars | |
| run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 11 | |
| distribution: 'zulu' | |
| - name: status | |
| run: echo Build is tagged. Uploading artifact ${{ steps.vars.outputs.tag }} to maven central. | |
| - run: scripts/setup-signing-key.sh | |
| env: | |
| DECRYPTER: ${{ secrets.DECRYPTER }} | |
| SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
| PASSPHRASE: ${{ secrets.PASSPHRASE }} | |
| # - name: Publish GitHub Pages | |
| # run: ./gradlew --info -Dbuild.version="${{ steps.vars.outputs.tag }}" mkdocsPublish | |
| - name: deploy to sonatype and publish to maven central | |
| run: ./gradlew -Pversion=$REF_NAME setLibraryVersion -Dbuild.version="${{ steps.vars.outputs.tag }}" clean publishToSonatype closeAndReleaseSonatypeStagingRepository | |
| env: | |
| GITHUB_TAG: ${{ steps.vars.outputs.tag }} | |
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| - name: Slack notification | |
| if: success() # only when previous step succeeds | |
| env: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| SLACK_USERNAME: Github Release Action. | |
| SLACK_CHANNEL: java-sync | |
| uses: Ilshidur/action-slack@master | |
| with: | |
| args: 'Version: <https://github.com/commercetools/commercetools-sync-java/releases/tag/${{ steps.vars.outputs.tag }}|${{ steps.vars.outputs.tag }}> of the library has been published to the <https://repo1.maven.org/maven2/com/commercetools/commercetools-sync-java/|Maven Central>.' |