Release version 10.0.2 (#1125) #85
Workflow file for this run
This file contains 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 ::set-output name=libVersion::${GITHUB_REF#refs/*/} | |
- 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 ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- 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. | |
- 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 setLibraryVersion -Dbuild.version="${{ steps.vars.outputs.tag }}" publishToSonatype closeAndReleaseSonatypeStagingRepository | |
env: | |
GITHUB_TAG: ${{ steps.vars.outputs.tag }} | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
PGP_KEY: ${{ secrets.PGP_KEY }} | |
PGP_PASSWORD: ${{ secrets.PGP_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>.' |