From 68c97f7ae6d1c634cc1f099f39f42cb2218e6ef7 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Fri, 3 Mar 2023 23:21:36 +0800 Subject: [PATCH 1/2] build: Add artifacting of PR build --- .github/workflows/test.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fe2e3b1d..c5b55297 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,12 @@ jobs: distribution: 'adopt' cache: gradle + - name: Get PR number + id: pr + run: echo "::set-output name=pull_request_number::$(gh pr view --json number -q .number || echo "")" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@v1 @@ -26,4 +32,14 @@ jobs: with: arguments: build env: + GITHUB_VERSION: pr${{ steps.pr.outputs.pull_request_number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Staging artifact + run: mkdir staging && cp build/libs/*.jar staging + + - name: Artifact output + uses: actions/upload-artifact@v2 + with: + name: multiverse-core-pr${{ steps.pr.outputs.pull_request_number }} + path: staging From 3b44ea218dc84786addd0dc353e6ef587eeb5ed4 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Fri, 3 Mar 2023 23:28:55 +0800 Subject: [PATCH 2/2] build: Fix PR build number --- .github/workflows/test.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c5b55297..68d7ff4e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,12 +18,6 @@ jobs: distribution: 'adopt' cache: gradle - - name: Get PR number - id: pr - run: echo "::set-output name=pull_request_number::$(gh pr view --json number -q .number || echo "")" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@v1 @@ -32,14 +26,11 @@ jobs: with: arguments: build env: - GITHUB_VERSION: pr${{ steps.pr.outputs.pull_request_number }} + GITHUB_VERSION: pr${{ github.event.pull_request.number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Staging artifact - run: mkdir staging && cp build/libs/*.jar staging - - name: Artifact output - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: - name: multiverse-core-pr${{ steps.pr.outputs.pull_request_number }} - path: staging + name: multiverse-core-pr${{ github.event.pull_request.number }} + path: build/libs/multiverse-core-pr${{ github.event.pull_request.number }}.jar