Skip to content

Commit

Permalink
upload artifact from build step
Browse files Browse the repository at this point in the history
  • Loading branch information
der-fruhling committed Aug 10, 2024
1 parent c0b80fc commit 9eb9461
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 9eb9461

Please sign in to comment.