Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish snapshot and test results are skipped when workflow is run by dependabot #99

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/compaund-java-sonatype-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,31 @@ jobs:
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: wrapper
- name: Release Build with Gradle
- name: Build release with Gradle
if: ${{ inputs.closeAndRelease }}
run: ./gradlew -p ${{ inputs.projectPath }} --info clean build -Prelease_version=${{ inputs.version }} publish closeAndReleaseSonatypeStagingRepository
run: ./gradlew -p ${{ inputs.projectPath }} --info clean build -Prelease_version=${{ inputs.version }}
- name: Publish release with Gradle
if: ${{ inputs.closeAndRelease }}
run: ./gradlew -p ${{ inputs.projectPath }} --info -Prelease_version=${{ inputs.version }} publish closeAndReleaseSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.sonatypeUsername }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.sonatypePassword }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.sonatypeSigningKey }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.sonatypeSigningPassword }}
- name: Dev Build with Gradle
- name: Build snapshot with Gradle
if: ${{ !inputs.closeAndRelease }}
run: ./gradlew -p ${{ inputs.projectPath }} --info clean build -Prelease_version=${{ format('{0}-SNAPSHOT', inputs.version) }} publish
run: ./gradlew -p ${{ inputs.projectPath }} --info clean build -Prelease_version=${{ format('{0}-SNAPSHOT', inputs.version) }}
- name: Publish snapshot with Gradle
if: ${{ !inputs.closeAndRelease && github.actor != 'dependabot[bot]' }}
run: ./gradlew -p ${{ inputs.projectPath }} --info -Prelease_version=${{ format('{0}-SNAPSHOT', inputs.version) }} publish
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.sonatypeUsername }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.sonatypePassword }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.sonatypeSigningKey }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.sonatypeSigningPassword }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
if: always() && github.actor != 'dependabot[bot]'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: We can request permissions for the job to allow comments on PR. You can read more here

with:
files: |
${{ inputs.projectPath }}/build/test-results/**/*.xml
Expand Down