Skip to content

Merge pull request #100 from reactive-commons/feature/eda-secret #274

Merge pull request #100 from reactive-commons/feature/eda-secret

Merge pull request #100 from reactive-commons/feature/eda-secret #274

Workflow file for this run

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 --refresh-dependencies --no-daemon --continue -Denv.ci=true
- 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 }}
- name: Generate Changelog
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
pullRequests: true
prWoLabels: true
issues: true
issuesWoLabels: true
stripGeneratorNotice: true
- name: Push 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
name: ${{ github.actor }}
email: ${{ github.actor }}@users.noreply.github.com
# - name: Push codeCoverage to Codecov
# run: bash <(curl -s https://codecov.io/bash)