From 582de898b3a9dbdee37c3d76603847cb810c777f Mon Sep 17 00:00:00 2001 From: Xujiayao Date: Mon, 8 Aug 2022 12:16:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0build=20workflow=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9377e300..bb0881b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,36 +1,27 @@ name: build -on: [ pull_request, push ] +on: [ push ] jobs: build: - strategy: - matrix: - java: [ 17 ] - os: [ ubuntu-latest ] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v2 - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - - name: Setup JDK ${{ matrix.java }} - uses: actions/setup-java@v1 + uses: actions/checkout@v3 + - name: Setup JDK 17 + uses: actions/setup-java@v3 with: - java-version: ${{ matrix.java }} - - name: Make Gradle Wrapper Executable - if: ${{ runner.os != 'Windows' }} - run: chmod +x ./gradlew + java-version: 17 - name: Build - run: ./gradlew build + uses: gradle/gradle-build-action@v2 + with: + arguments: build - name: Find Correct JAR id: findjar - if: ${{ runner.os == 'Linux' && matrix.java == '17' }} run: | output="$(find wrapper/build/libs/ ! -name "*-sources.jar" -type f -printf "%f\n")" echo "::set-output name=jarname::$output" - - name: Capture Build Artifacts - if: ${{ runner.os == 'Linux' && matrix.java == '17' }} - uses: actions/upload-artifact@v2 + - name: Upload Build Artifacts + uses: actions/upload-artifact@v3 with: name: ${{ steps.findjar.outputs.jarname }} path: wrapper/build/libs/${{ steps.findjar.outputs.jarname }} \ No newline at end of file