Skip to content

Commit

Permalink
Refactor build/release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermocalvo committed Feb 14, 2024
1 parent 18f154d commit 0d47889
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
build-scan-publish: true
build-scan-terms-of-service-url: https://gradle.com/terms-of-service
build-scan-terms-of-service-agree: yes
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}

# ================================
Expand All @@ -76,22 +79,35 @@ jobs:
- name: Build
uses: gradle/actions/setup-gradle@v3
with:
arguments: build -x check --info --scan
arguments: build -x check --info

# ================================
# CHECK
# ================================
- name: Check
uses: gradle/actions/setup-gradle@v3
with:
arguments: check --info --scan
arguments: check --info

# ================================
# COMPATIBILITY REPORT
# ================================
- name: Compatibility report
run: cat ./api-compatibility/build/report.txt >> $GITHUB_STEP_SUMMARY

# ================================
# CACHE SONARCLOUD PACKAGES
# ================================
- name: Cache SonarCloud packages
if: ${{ matrix.jdk == 21 }}
uses: actions/cache@v4
with:
key: ${{ runner.os }}-sonar
path: |
~/.sonar/cache
restore-keys: |
${{ runner.os }}-sonar
# ================================
# ANALYZE
# ================================
Expand All @@ -103,4 +119,4 @@ jobs:
SONAR_ORGANIZATION: leakyabstractions
uses: gradle/actions/setup-gradle@v3
with:
arguments: sonarqube --info --scan
arguments: sonarqube --info
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
steps:

# ================================
# CHECKOUT
# SHALLOW CLONE
# ================================
- name: Checkout git tag
- name: Shallow clone
uses: actions/checkout@v4

# ================================
Expand Down Expand Up @@ -50,4 +50,7 @@ jobs:
ORG_GRADLE_PROJECT_sonatypeStagingProfileId: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
uses: gradle/actions/setup-gradle@v3
with:
arguments: publish -Prelease --info --scan
build-scan-publish: true
build-scan-terms-of-service-url: https://gradle.com/terms-of-service
build-scan-terms-of-service-agree: yes
arguments: publish -Prelease --info
7 changes: 0 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePass
}
}

if (hasProperty('buildScan')) {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
}

/**
* Print project property by key
* - Usage: `./gradlew -q printProperty -Pkey=description`
Expand Down

0 comments on commit 0d47889

Please sign in to comment.