diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 39ed85d..dbcdaa8 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,8 +5,27 @@ on: branches: - main jobs: - publish: + event-file: + # https://github.com/marketplace/actions/publish-test-results#support-fork-repositories-and-dependabot-branches + name: "Event File" runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: event-file + path: ${{ github.event_path }} + publish: + strategy: + matrix: + os: + - ubuntu-latest + # - windows-latest + # - macos-latest + java: + - 8 + # - 17 + runs-on: ${{ matrix.os }} timeout-minutes: 20 steps: - uses: actions/checkout@v3 @@ -16,18 +35,21 @@ jobs: uses: actions/setup-java@v3.12.0 with: distribution: 'zulu' - java-version: 8 - cache: 'gradle' + java-version: ${{ matrix.java }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 - name: build publish run: ./gradlew clean build publish --info --stacktrace env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGNING_KEY }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_SIGNING_PASSWORD }} - - name: Publish Test Report - if: ${{ always() }} - uses: scacap/action-surefire-report@v1 + - name: Upload Test Results + # see publish-test-results.yml for workflow that publishes test results without security issues for forks + # https://github.com/marketplace/actions/publish-test-results#support-fork-repositories-and-dependabot-branches + if: always() + uses: actions/upload-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - report_paths: '**/build/test-results/test/TEST-*.xml' + name: Test Results (Java ${{ matrix.java }} on ${{ matrix.os }}) + path: '**/build/test-results/test/TEST-*.xml' ... diff --git a/.github/workflows/publish-test-results.yml b/.github/workflows/publish-test-results.yml index 18cbc44..bbb0ba2 100644 --- a/.github/workflows/publish-test-results.yml +++ b/.github/workflows/publish-test-results.yml @@ -11,6 +11,7 @@ on: workflows: - CI - Publish + - Release types: - completed permissions: {} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f37376..ff1051f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,8 +7,27 @@ on: # - published jobs: - release: + event-file: + # https://github.com/marketplace/actions/publish-test-results#support-fork-repositories-and-dependabot-branches + name: "Event File" runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: event-file + path: ${{ github.event_path }} + release: + strategy: + matrix: + os: + - ubuntu-latest + # - windows-latest + # - macos-latest + java: + - 8 + # - 17 + runs-on: ${{ matrix.os }} timeout-minutes: 20 steps: - uses: actions/checkout@v3 @@ -18,8 +37,9 @@ jobs: uses: actions/setup-java@v3.12.0 with: distribution: 'zulu' - java-version: 8 - cache: 'gradle' + java-version: ${{ matrix.java }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 - name: Set artifact version run: | echo "RELEASE_VERSION=$(echo '${{ github.event.release.tag_name }}' | sed -e s/^v//)" >> $GITHUB_ENV @@ -32,10 +52,12 @@ jobs: SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - - name: Publish Test Report - if: ${{ always() }} - uses: scacap/action-surefire-report@v1 + - name: Upload Test Results + # see publish-test-results.yml for workflow that publishes test results without security issues for forks + # https://github.com/marketplace/actions/publish-test-results#support-fork-repositories-and-dependabot-branches + if: always() + uses: actions/upload-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - report_paths: '**/build/test-results/test/TEST-*.xml' + name: Test Results (Java ${{ matrix.java }} on ${{ matrix.os }}) + path: '**/build/test-results/test/TEST-*.xml' ...