-
Notifications
You must be signed in to change notification settings - Fork 37
70 lines (68 loc) · 2.68 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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>.'