chore(deps): Update dependency org.incendo:cloud-build-logic to v0.0.2 #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "build" | |
on: | |
push: | |
branches: [ "**" ] | |
tags: [ "**" ] | |
pull_request: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
java: [ "17" ] | |
os: [ "ubuntu-latest" ] | |
# Only run on PRs if the source branch is on someone else's repo | |
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} | |
runs-on: "${{ matrix.os }}" | |
steps: | |
- name: "checkout repository" | |
uses: "actions/checkout@v4" | |
- name: "validate gradle wrapper" | |
uses: gradle/wrapper-validation-action@v1 | |
- name: "setup jdk ${{ matrix.java }}" | |
uses: "actions/setup-java@v4" | |
with: | |
distribution: 'temurin' | |
java-version: "${{ matrix.java }}" | |
- name: "setup gradle" | |
uses: gradle/gradle-build-action@v2 | |
- name: "build" | |
run: "./gradlew build" | |
- name: "determine status" | |
run: | | |
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then | |
echo "STATUS=snapshot" >> $GITHUB_ENV | |
else | |
echo "STATUS=release" >> $GITHUB_ENV | |
fi | |
- name: "publish snapshot" | |
if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}" | |
run: ./gradlew publish | |
env: | |
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}" | |
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}" | |
- name: "publish release" | |
if: "${{ env.STATUS == 'release' && startsWith(github.ref, 'refs/tags/') }}" | |
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | |
env: | |
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}" | |
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}" | |
ORG_GRADLE_PROJECT_signingKey: "${{ secrets.SIGNING_KEY }}" | |
ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.SIGNING_PASSWORD }}" |