Skip to content

Commit

Permalink
Merge snapshot and build pipelines together
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermocalvo committed Feb 15, 2024
1 parent 760a1a4 commit 882a86f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 65 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,20 @@ jobs:
build-scan-terms-of-service-agree: yes
cache-read-only: ${{ github.event_name != 'push' }}

# ================================
# EXPORT GRADLE PROPERTIES
# ================================
- name: Export Gradle properties
id: properties
uses: guillermocalvo/gradle-properties@v3
with:
output_file: ${{ github.output }}
export: version,previousVersion

# ================================
# BUILD
# ================================
- name: Build
- name: Build version ${{ steps.properties.outputs.version }}
uses: gradle/actions/setup-gradle@v3
with:
arguments: build -x check --info
Expand All @@ -80,7 +90,7 @@ jobs:
# ================================
# COMPATIBILITY REPORT
# ================================
- name: Compatibility report
- name: Compatibility with version ${{ steps.properties.outputs.previousVersion }}
if: ${{ matrix.jdk == 21 }}
run: cat ./api-compatibility/build/report.txt >> $GITHUB_STEP_SUMMARY

Expand Down Expand Up @@ -109,3 +119,17 @@ jobs:
uses: gradle/actions/setup-gradle@v3
with:
arguments: sonarqube --info

# ================================
# PUBLISH SNAPSHOT
# ================================
- name: Publish snapshot version ${{ steps.properties.outputs.version }}
if: ${{ matrix.jdk == 21 && github.event_name == 'push' && github.ref_name == github.event.repository.default_branch && endsWith(steps.properties.outputs.version, '-SNAPSHOT') }}
env:
ORG_GRADLE_PROJECT_githubUsername: ${{ secrets.PUBLISH_USERNAME }}
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.PUBLISH_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
uses: gradle/actions/setup-gradle@v3
with:
arguments: publish -Psnapshot --info
53 changes: 0 additions & 53 deletions .github/workflows/snapshot.yml

This file was deleted.

10 changes: 0 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,3 @@ if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePass
}
}
}

/**
* Print project property by key
* - Usage: `./gradlew -q printProperty -Pkey=description`
*/
task printProperty {
doLast {
printf project[project.key]
}
}

0 comments on commit 882a86f

Please sign in to comment.