From 957b4714a542bad24df2966581d3bd97421ebdfc Mon Sep 17 00:00:00 2001 From: Reider745 <70357814+Reider745@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:18:40 +0300 Subject: [PATCH 1/9] Create github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/github-actions-demo.yml diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml new file mode 100644 index 00000000..4f485c4b --- /dev/null +++ b/.github/workflows/github-actions-demo.yml @@ -0,0 +1,25 @@ +name: Gradle Build + +on: + push: + branches: + - NukkitMot + pull_request: + branches: + - NukkitMot + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + + - name: Build with Gradle + run: ./gradlew build From 31fa7190a4e86039b6ce19873522c275fa295a33 Mon Sep 17 00:00:00 2001 From: Reider745 <70357814+Reider745@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:23:52 +0300 Subject: [PATCH 2/9] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 4f485c4b..5b62b377 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -22,4 +22,4 @@ jobs: java-version: 17 - name: Build with Gradle - run: ./gradlew build + run: gradlew build From b47050643f3e0eee46d65bbe1e81d0168d054625 Mon Sep 17 00:00:00 2001 From: Reider745 <70357814+Reider745@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:27:29 +0300 Subject: [PATCH 3/9] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 5b62b377..c1320673 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -13,13 +13,14 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - - name: Build with Gradle - run: gradlew build + - uses: actions/checkout@v4 + - uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3 + - name: Run the Gradle package task + uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 + with: + arguments: -b ci.gradle package From 948d00796d8aa8f2a4f9bad9a547a08db4d1e5d4 Mon Sep 17 00:00:00 2001 From: Reider745 <70357814+Reider745@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:30:11 +0300 Subject: [PATCH 4/9] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index c1320673..b0ec801c 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -20,7 +20,11 @@ jobs: distribution: 'temurin' - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3 - - name: Run the Gradle package task + - name: Build with Gradle uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 with: - arguments: -b ci.gradle package + arguments: build + - uses: actions/upload-artifact@v3 + with: + name: Package + path: build/libs From 8f235e1bfb2f66745d883d75f881ccd0c185b523 Mon Sep 17 00:00:00 2001 From: Reider745 <70357814+Reider745@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:33:18 +0300 Subject: [PATCH 5/9] Update and rename github-actions-demo.yml to gradle.yml --- .github/workflows/github-actions-demo.yml | 30 -------------------- .github/workflows/gradle.yml | 34 +++++++++++++++++++++++ 2 files changed, 34 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/github-actions-demo.yml create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml deleted file mode 100644 index b0ec801c..00000000 --- a/.github/workflows/github-actions-demo.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Gradle Build - -on: - push: - branches: - - NukkitMot - pull_request: - branches: - - NukkitMot - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3 - - name: Build with Gradle - uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 - with: - arguments: build - - uses: actions/upload-artifact@v3 - with: - name: Package - path: build/libs diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 00000000..74ece1f7 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,34 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Java CI with Gradle + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + - name: Build with Gradle + uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 + with: + arguments: build From 441cd43d4bf32f4902f5b5b83099fb727ab7eb5f Mon Sep 17 00:00:00 2001 From: Reider745 <70357814+Reider745@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:36:12 +0300 Subject: [PATCH 6/9] Update gradle.yml --- .github/workflows/gradle.yml | 54 ++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 74ece1f7..3aeb29d6 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -19,16 +19,46 @@ permissions: jobs: build: - runs-on: ubuntu-latest + - name: Gradle Build Action + # You may pin to the exact commit or the version. + # uses: gradle/gradle-build-action@87a9a15658c426a54dd469d4fc7dc1a73ca9d4a6 + uses: gradle/gradle-build-action@v2.10.0 + with: + # Gradle version to use. If specified, this Gradle version will be downloaded, added to the PATH and used for invoking Gradle. + gradle-version: # optional + # Path to the Gradle executable. If specified, this executable will be added to the PATH and used for invoking Gradle. + gradle-executable: # optional + # Path to the root directory of the build. Default is the root of the GitHub workspace. + build-root-directory: # optional + # When 'true', all caching is disabled. No entries will be written to or read from the cache. + cache-disabled: false # optional + # When 'true', existing entries will be read from the cache but no entries will be written. - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - - name: Build with Gradle - uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 - with: - arguments: build + cache-read-only: false # optional, default is ${{ github.event.repository != null && github.ref_name != github.event.repository.default_branch }} + # When 'true', entries will not be restored from the cache but will be saved at the end of the Job. + + cache-write-only: # optional + # When 'true', a pre-existing Gradle User Home will not prevent the cache from being restored. + cache-overwrite-existing: # optional + # Paths within Gradle User Home to cache. + gradle-home-cache-includes: # optional, default is caches + + # Paths within Gradle User Home to exclude from cache. + gradle-home-cache-excludes: # optional + # When 'true', the action will attempt to remove any stale/unused entries from the Gradle User Home prior to saving to the GitHub Actions cache. + gradle-home-cache-cleanup: # optional + # Gradle command line arguments (supports multi-line input) + arguments: # optional + # When 'false', no Job Summary will be generated for the Job. + generate-job-summary: # optional, default is true + # Specifies if a GitHub dependency snapshot should be generated for each Gradle build, and if so, how. Valid values are 'disabled' (default), 'generate', 'generate-and-submit' and 'download-and-submit'. + dependency-graph: # optional, default is disabled + # Specifies the number of days to retain any artifacts generated by the action. If not set, the default retention settings for the repository will apply. + artifact-retention-days: # optional + # When 'true', the action will not attempt to restore the Gradle User Home entries from other Jobs. + gradle-home-cache-strict-match: # optional + # Used to uniquely identify the current job invocation. Defaults to the matrix values for this job; this should not be overridden by users (INTERNAL). + workflow-job-context: # optional, default is ${{ toJSON(matrix) }} + # The GitHub token used to authenticate when submitting via the Dependency Submission API. + github-token: # optional, default is ${{ github.token }} + From 2b00d8c58e164d99cd139b229800b3c8f6572ca7 Mon Sep 17 00:00:00 2001 From: Reider745 <70357814+Reider745@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:38:54 +0300 Subject: [PATCH 7/9] Update gradle.yml --- .github/workflows/gradle.yml | 76 +++++++++++------------------------- 1 file changed, 22 insertions(+), 54 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 3aeb29d6..103d143f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,64 +1,32 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle - -name: Java CI with Gradle +name: Gradle Build Pipeline on: push: - branches: [ "main" ] + branches: [ "NukkitMot" ] pull_request: - branches: [ "main" ] + branches: [ "NukkitMot" ] permissions: contents: read jobs: - build: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'corretto' + + - name: Check codestyle + uses: gradle/gradle-build-action@v2 + with: + arguments: spotlessCheck - - name: Gradle Build Action - # You may pin to the exact commit or the version. - # uses: gradle/gradle-build-action@87a9a15658c426a54dd469d4fc7dc1a73ca9d4a6 - uses: gradle/gradle-build-action@v2.10.0 - with: - # Gradle version to use. If specified, this Gradle version will be downloaded, added to the PATH and used for invoking Gradle. - gradle-version: # optional - # Path to the Gradle executable. If specified, this executable will be added to the PATH and used for invoking Gradle. - gradle-executable: # optional - # Path to the root directory of the build. Default is the root of the GitHub workspace. - build-root-directory: # optional - # When 'true', all caching is disabled. No entries will be written to or read from the cache. - cache-disabled: false # optional - # When 'true', existing entries will be read from the cache but no entries will be written. - - cache-read-only: false # optional, default is ${{ github.event.repository != null && github.ref_name != github.event.repository.default_branch }} - # When 'true', entries will not be restored from the cache but will be saved at the end of the Job. - - cache-write-only: # optional - # When 'true', a pre-existing Gradle User Home will not prevent the cache from being restored. - cache-overwrite-existing: # optional - # Paths within Gradle User Home to cache. - gradle-home-cache-includes: # optional, default is caches - - # Paths within Gradle User Home to exclude from cache. - gradle-home-cache-excludes: # optional - # When 'true', the action will attempt to remove any stale/unused entries from the Gradle User Home prior to saving to the GitHub Actions cache. - gradle-home-cache-cleanup: # optional - # Gradle command line arguments (supports multi-line input) - arguments: # optional - # When 'false', no Job Summary will be generated for the Job. - generate-job-summary: # optional, default is true - # Specifies if a GitHub dependency snapshot should be generated for each Gradle build, and if so, how. Valid values are 'disabled' (default), 'generate', 'generate-and-submit' and 'download-and-submit'. - dependency-graph: # optional, default is disabled - # Specifies the number of days to retain any artifacts generated by the action. If not set, the default retention settings for the repository will apply. - artifact-retention-days: # optional - # When 'true', the action will not attempt to restore the Gradle User Home entries from other Jobs. - gradle-home-cache-strict-match: # optional - # Used to uniquely identify the current job invocation. Defaults to the matrix values for this job; this should not be overridden by users (INTERNAL). - workflow-job-context: # optional, default is ${{ toJSON(matrix) }} - # The GitHub token used to authenticate when submitting via the Dependency Submission API. - github-token: # optional, default is ${{ github.token }} - + - name: Build + uses: gradle/gradle-build-action@v2 + with: + arguments: assemble From b5c6d090c6f59a342bc5a83419842e34c7b71133 Mon Sep 17 00:00:00 2001 From: Reider745 <70357814+Reider745@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:40:46 +0300 Subject: [PATCH 8/9] Update gradle.yml --- .github/workflows/gradle.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 103d143f..601372d0 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -20,11 +20,6 @@ jobs: with: java-version: '17' distribution: 'corretto' - - - name: Check codestyle - uses: gradle/gradle-build-action@v2 - with: - arguments: spotlessCheck - name: Build uses: gradle/gradle-build-action@v2 From 22e07b3efb5886e5927e61f4b8001165236273d6 Mon Sep 17 00:00:00 2001 From: Reider745 <70357814+Reider745@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:49:12 +0300 Subject: [PATCH 9/9] Update gradle.yml --- .github/workflows/gradle.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 601372d0..58aad5e5 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -20,6 +20,9 @@ jobs: with: java-version: '17' distribution: 'corretto' + + - name: Make gradlew executable + run: chmod +x ./gradlew - name: Build uses: gradle/gradle-build-action@v2