-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9275955
commit ebe46b6
Showing
2 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ on: | |
tags-ignore: [ "**" ] | ||
pull_request: | ||
release: | ||
types: [ released ] | ||
types: [ published ] | ||
jobs: | ||
build: | ||
# Only run on PRs if the source branch is on someone else's repo | ||
|
@@ -19,13 +19,19 @@ jobs: | |
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
- uses: gradle/gradle-build-action@v2 | ||
with: | ||
# allow main and *-dev branches to write caches (default is only main/main) | ||
cache-read-only: ${{ github.ref != 'refs/heads/main' && !(endsWith(github.ref, '-dev') && startsWith(github.ref, 'refs/heads/')) }} | ||
- name: Build | ||
run: ./gradlew build | ||
- name : Test Summary | ||
uses : EnricoMi/[email protected] | ||
with : | ||
junit_files : "**/build/test-results/test/TEST-*.xml" | ||
if : always() | ||
- name: Upload Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Test Results | ||
path: | | ||
**/build/test-results/test/TEST-*.xml | ||
- name: Determine Status | ||
run: | | ||
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then | ||
|
@@ -34,7 +40,7 @@ jobs: | |
echo "STATUS=release" >> $GITHUB_ENV | ||
fi | ||
- name: Publish Snapshot | ||
if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}" | ||
if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}" | ||
run: ./gradlew publish | ||
env: | ||
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}" | ||
|
@@ -47,3 +53,14 @@ jobs: | |
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}" | ||
ORG_GRADLE_PROJECT_signingKey: "${{ secrets.SIGNING_KEY }}" | ||
ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.SIGNING_PASSWORD }}" | ||
event_file: | ||
name: "Event File" | ||
# 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: ubuntu-latest | ||
steps: | ||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Event File | ||
path: ${{ github.event_path }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Test Results | ||
|
||
on: | ||
workflow_run: | ||
workflows: [ "Build cloud-spring" ] | ||
types: | ||
- completed | ||
permissions: { } | ||
|
||
jobs: | ||
test-results: | ||
name: Test Results | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion != 'skipped' | ||
permissions: | ||
checks: write | ||
# needed unless run with comment_mode: off | ||
pull-requests: write | ||
# required by download step to access artifacts API | ||
actions: read | ||
steps: | ||
- name: Download and Extract Artifacts | ||
uses: dawidd6/action-download-artifact@v3 | ||
with: | ||
run_id: ${{ github.event.workflow_run.id }} | ||
path: artifacts | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
commit: ${{ github.event.workflow_run.head_sha }} | ||
event_file: artifacts/Event File/event.json | ||
event_name: ${{ github.event.workflow_run.event }} | ||
files: "artifacts/**/*.xml" |