From 654b6fc41691f2cc4ae98eba256aeb51c66c7279 Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:11:27 +0300 Subject: [PATCH 01/16] Create gradle.yml --- .github/workflows/gradle.yml | 67 ++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..94d7ad5 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,67 @@ +# 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: [ "1.21" ] + pull_request: + branches: [ "1.21" ] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - name: Setup Gradle + uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + + - name: Build with Gradle Wrapper + run: ./gradlew build + + # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). + # If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version. + # + # - name: Setup Gradle + # uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + # with: + # gradle-version: '8.5' + # + # - name: Build with Gradle 8.5 + # run: gradle build + + dependency-submission: + + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. + # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 From 0ddf7cc9658c525545e2d49854a5d3cadb521fb5 Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:13:22 +0300 Subject: [PATCH 02/16] Update gradle.yml --- .github/workflows/gradle.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 94d7ad5..aff4c03 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -22,10 +22,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'temurin' # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. @@ -55,10 +55,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'temurin' # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. From 322073f47586ba58b3e7bde0a30eb7b4b5abcaa9 Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:17:49 +0300 Subject: [PATCH 03/16] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6244f66..de1303a 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ A mod that will monitor the current version of your resource pack and download a [![Static Badge](https://img.shields.io/badge/Github-gray?logo=github) ](https://github.com/AdamCalculator/DynamicPack) +[![Java CI with Gradle](https://github.com/AdamCalculator/DynamicPack/actions/workflows/gradle.yml/badge.svg)](https://github.com/AdamCalculator/DynamicPack/actions/workflows/gradle.yml) + [![Banner](https://api.mcbanners.com/banner/saved/wveMrFfPsqwXbV.png)](https://modrinth.com/mod/dynamicpack) ## Documentation From 5998dea5639a6ad9af07093eb3affcbe14fe15a2 Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:36:01 +0300 Subject: [PATCH 04/16] Update gradle.yml --- .github/workflows/gradle.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index aff4c03..b60fed6 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -36,6 +36,22 @@ jobs: - name: Build with Gradle Wrapper run: ./gradlew build + - uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: test-results + path: junit.xml + + - uses: actions/upload-artifact@v4 + with: + name: dynamicpack-fabric-builds + path: fabric/build/libs/ + + - uses: actions/upload-artifact@v4 + with: + name: dynamicpack-common-builds + path: common/build/libs/ + # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). # If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version. # From efbda1e70580bde0e56f2de558d20ed424ecc928 Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:06:57 +0300 Subject: [PATCH 05/16] Update gradle.yml --- .github/workflows/gradle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index b60fed6..a70cc99 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -44,12 +44,12 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: dynamicpack-fabric-builds + name: dynamicpack-fabric-builds-${{ github.sha }} path: fabric/build/libs/ - uses: actions/upload-artifact@v4 with: - name: dynamicpack-common-builds + name: dynamicpack-common-builds-${{ github.sha }} path: common/build/libs/ # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). From f69eebdc038601f55508dd588efb3385c1f319bd Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:11:18 +0300 Subject: [PATCH 06/16] Update gradle.yml --- .github/workflows/gradle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index a70cc99..2cbd1ec 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -44,12 +44,12 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: dynamicpack-fabric-builds-${{ github.sha }} + name: dynamicpack-fabric-builds-${{ github.ref }} path: fabric/build/libs/ - uses: actions/upload-artifact@v4 with: - name: dynamicpack-common-builds-${{ github.sha }} + name: dynamicpack-common-builds-${{ github.ref }} path: common/build/libs/ # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). From 70b4e9484e5a58f53ed036e3d9c401cf6f6bb5fe Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:18:49 +0300 Subject: [PATCH 07/16] Update gradle.yml --- .github/workflows/gradle.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 2cbd1ec..e2296e9 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -21,6 +21,9 @@ jobs: contents: read steps: + - name: Set environment variable + run: echo "MY_SHA_TRIM={${{ github.sha }}:0:7}" >> $GITHUB_ENV + - uses: actions/checkout@v4 - name: Set up JDK 21 uses: actions/setup-java@v4 @@ -44,12 +47,12 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: dynamicpack-fabric-builds-${{ github.ref }} + name: dynamicpack-fabric-builds-${{ github.MY_SHA_TRIM }} path: fabric/build/libs/ - uses: actions/upload-artifact@v4 with: - name: dynamicpack-common-builds-${{ github.ref }} + name: dynamicpack-common-builds-${{ github.MY_SHA_TRIM }} path: common/build/libs/ # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). From 44bb3681b20401760ea0c25517744decb02c5584 Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:21:24 +0300 Subject: [PATCH 08/16] Update gradle.yml --- .github/workflows/gradle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index e2296e9..70cda6d 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -47,12 +47,12 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: dynamicpack-fabric-builds-${{ github.MY_SHA_TRIM }} + name: dynamicpack-fabric-builds-${{ env.MY_SHA_TRIM }} path: fabric/build/libs/ - uses: actions/upload-artifact@v4 with: - name: dynamicpack-common-builds-${{ github.MY_SHA_TRIM }} + name: dynamicpack-common-builds-${{ env.MY_SHA_TRIM }} path: common/build/libs/ # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). From d17cf126e2f4859e5e62c1f001704b3f5449175d Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:27:33 +0300 Subject: [PATCH 09/16] Update gradle.yml --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 70cda6d..0ccc266 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Set environment variable - run: echo "MY_SHA_TRIM={${{ github.sha }}:0:7}" >> $GITHUB_ENV + run: my_hash = {${{ github.sha }}:0:7} && echo ("MY_SHA_TRIM=" + my_hash) >> $GITHUB_ENV - uses: actions/checkout@v4 - name: Set up JDK 21 From 52c6d986faa5d70b7633ec2ff23ff8d0e6a2a05d Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:28:39 +0300 Subject: [PATCH 10/16] Update gradle.yml --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0ccc266..501df8c 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Set environment variable - run: my_hash = {${{ github.sha }}:0:7} && echo ("MY_SHA_TRIM=" + my_hash) >> $GITHUB_ENV + run: my_hash = {${{ github.sha }}:0:7} && echo "MY_SHA_TRIM=" + my_hash >> $GITHUB_ENV - uses: actions/checkout@v4 - name: Set up JDK 21 From 737bbc32d82933842391c7a5d2d852afcaaa5fc9 Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:29:23 +0300 Subject: [PATCH 11/16] Update gradle.yml --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 501df8c..7be06fb 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Set environment variable - run: my_hash = {${{ github.sha }}:0:7} && echo "MY_SHA_TRIM=" + my_hash >> $GITHUB_ENV + run: $my_hash = {${{ github.sha }}:0:7} && echo "MY_SHA_TRIM=$my_hash" >> $GITHUB_ENV - uses: actions/checkout@v4 - name: Set up JDK 21 From 77b943b1eab54e8588cf935da17ad79e1caf005e Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:31:15 +0300 Subject: [PATCH 12/16] Update gradle.yml --- .github/workflows/gradle.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 7be06fb..234483b 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -22,7 +22,9 @@ jobs: steps: - name: Set environment variable - run: $my_hash = {${{ github.sha }}:0:7} && echo "MY_SHA_TRIM=$my_hash" >> $GITHUB_ENV + run: | + | $my_hash = {${{ github.sha }}:0:7} + | echo "MY_SHA_TRIM=$my_hash" >> $GITHUB_ENV - uses: actions/checkout@v4 - name: Set up JDK 21 From b3cc0befa116548dc1285be30ab2e1289904b51e Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:32:16 +0300 Subject: [PATCH 13/16] Update gradle.yml --- .github/workflows/gradle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 234483b..abee724 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -23,8 +23,8 @@ jobs: steps: - name: Set environment variable run: | - | $my_hash = {${{ github.sha }}:0:7} - | echo "MY_SHA_TRIM=$my_hash" >> $GITHUB_ENV + $my_hash = {${{ github.sha }}:0:7} + echo "MY_SHA_TRIM=$my_hash" >> $GITHUB_ENV - uses: actions/checkout@v4 - name: Set up JDK 21 From 1db5dd72681cc2dad1590cecbcbda456a2756b84 Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:33:28 +0300 Subject: [PATCH 14/16] Update gradle.yml --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index abee724..6147cdd 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Set environment variable run: | - $my_hash = {${{ github.sha }}:0:7} + my_hash={${{ github.sha }}:0:7} echo "MY_SHA_TRIM=$my_hash" >> $GITHUB_ENV - uses: actions/checkout@v4 From 8acbf39d00c1b675d4f54ed0ea6245d5134d0f7e Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:37:30 +0300 Subject: [PATCH 15/16] Update gradle.yml --- .github/workflows/gradle.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 6147cdd..0c776e7 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -23,7 +23,8 @@ jobs: steps: - name: Set environment variable run: | - my_hash={${{ github.sha }}:0:7} + sha = ${{ github.sha }} + my_hash=${sha:0:7} echo "MY_SHA_TRIM=$my_hash" >> $GITHUB_ENV - uses: actions/checkout@v4 From 6437fbc1cb65e362b16b9baa78f0330acb2cfbdf Mon Sep 17 00:00:00 2001 From: AdamCalculator <156993728+AdamCalculator@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:38:25 +0300 Subject: [PATCH 16/16] Update gradle.yml --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0c776e7..7064654 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Set environment variable run: | - sha = ${{ github.sha }} + sha=${{ github.sha }} my_hash=${sha:0:7} echo "MY_SHA_TRIM=$my_hash" >> $GITHUB_ENV