-
Notifications
You must be signed in to change notification settings - Fork 31
87 lines (82 loc) · 3.13 KB
/
main.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: 'reactive-commons-ci-cd'
on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types: [ created ]
jobs:
build:
if: github.event_name != 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Execute build test jacocoTestReport and sonar analysis
if: endsWith(github.REF, '/master') == true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build test jacocoTestReport sonarqube --refresh-dependencies --no-daemon --continue -Denv.ci=true
- name: Execute build test jacocoTestReport pull request
if: endsWith(github.REF, '/merge') == true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build test jacocoTestReport --refresh-dependencies --no-daemon --continue -Denv.ci=true
release:
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# - name: Execute jacocoTestReport
# run: ./gradlew test jacocoTestReport && cp build/reports/jacoco/report.xml jacoco.xml || echo "Code coverage failed"
- name: Build with Gradle
run: ./gradlew build asciidoctor --refresh-dependencies --no-daemon --continue -Denv.ci=true
- name: Generate Changelog
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
pullRequests: true
prWoLabels: true
issues: true
issuesWoLabels: true
stripGeneratorNotice: true
- name: Push Docs and Changelog
uses: github-actions-x/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: 'master'
commit-message: 'Automatic docs and changelog generation'
force-add: 'true'
files: CHANGELOG.md docs/
name: ${{ github.actor }}
email: ${{ github.actor }}@users.noreply.github.com
# - name: Push codeCoverage to Codecov
# run: bash <(curl -s https://codecov.io/bash)
- name: Prepare gpg key
run: |
echo "${{secrets.SIGNING_KEY_FILE}}" | base64 -d > ~/.gradle/secring.gpg
- name: Publish Libraries
run: ./gradlew publish -Psigning.keyId=${{ secrets.SIGNING_KEY_ID }} -Psigning.password=${{ secrets.SIGNING_KEY_PASSWORD }} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) -Denv.ci=true
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}