From 9eb946191b5df8f26cb93ad1df9b6a5e387bcbe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?der=5Ffr=C3=BChling?= Date: Sat, 10 Aug 2024 15:03:34 -0700 Subject: [PATCH] upload artifact from build step --- .github/workflows/gradle.yml | 19 ++++++++++++++++++- build.gradle | 7 ++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 9514c63..39ddb9a 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -45,8 +45,25 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + - name: Compute values + id: vars + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Build with Gradle Wrapper - run: ./gradlew build + run: ./gradlew -Pcommit_hash=${{ steps.vars.outputs.sha_short }} build + + - name: Upload Forge Artifacts + uses: actions/upload-artifact@v4 + with: + name: forge + path: forge/build/libs/*.jar + if-no-files-found: error + - name: Upload Fabric Artifacts + uses: actions/upload-artifact@v4 + with: + name: fabric + path: fabric/build/libs/*.jar + if-no-files-found: error # 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. diff --git a/build.gradle b/build.gradle index 4756441..837292c 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,12 @@ architectury { } group = maven_group -version = "${mod_version}+mc1.20.1" + +if(project.properties['commit_hash'] != null) { + version = "${mod_version}-commit.${project.properties['commit_hash']}+mc1.20.1" +} else { + version = "${mod_version}+mc1.20.1" +} subprojects { apply plugin: "dev.architectury.loom"