diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9800994..d318fa4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,11 @@ -name: Build +name: Build cloud-discord on: push: branches: [ "**" ] 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 @@ -20,8 +20,18 @@ jobs: distribution: 'temurin' java-version: 17 - uses: gradle/gradle-build-action@v2 + with: + # allow master and *-dev branches to write caches (default is only master/main) + cache-read-only: ${{ github.ref != 'refs/heads/master' && !(endsWith(github.ref, '-dev') && startsWith(github.ref, 'refs/heads/')) }} - name: Build run: ./gradlew build + - 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 @@ -43,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 }} diff --git a/.github/workflows/test_results.yml b/.github/workflows/test_results.yml new file mode 100644 index 0000000..116e075 --- /dev/null +++ b/.github/workflows/test_results.yml @@ -0,0 +1,33 @@ +name: Test Results + +on: + workflow_run: + workflows: [ "Build cloud-discord" ] + 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" diff --git a/cloud-javacord/build.gradle.kts b/cloud-javacord/build.gradle.kts index 1143204..cc79616 100644 --- a/cloud-javacord/build.gradle.kts +++ b/cloud-javacord/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id("cloud-discord.publishing-conventions") } -version = "2.0.0-SNAPSHOT" +version = "2.0.0-beta.1" dependencies { api(libs.cloud.core) diff --git a/cloud-jda/build.gradle.kts b/cloud-jda/build.gradle.kts index cab71a4..617a40e 100644 --- a/cloud-jda/build.gradle.kts +++ b/cloud-jda/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id("cloud-discord.publishing-conventions") } -version = "2.0.0-SNAPSHOT" +version = "2.0.0-beta.1" dependencies { api(libs.cloud.core) diff --git a/gradle.properties b/gradle.properties index d409f0c..60c978b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group=org.incendo -version=1.0.0-SNAPSHOT +version=1.0.0-beta.1 description=Discord integrations for Cloud. org.gradle.caching=true