Skip to content

Commit

Permalink
Refactor project setup to allow for dynamic version. Refactor the pul…
Browse files Browse the repository at this point in the history
…l-request action to build with a custom project version
  • Loading branch information
md5sha256 committed Apr 22, 2024
1 parent f47af06 commit 0066f4e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
echo "SHORT_COMMIT_HASH=$SHORT_COMMIT_HASH" >> "$GITHUB_ENV"
echo "SHORT_COMMIT_HASH=$SHORT_COMMIT_HASH" >> "$GITHUB_OUTPUT"
echo "JAR_VERSION=$JAR_VERSION" >> "$GITHUB_ENV"
sed -i "s/version = 4.9-UNOFFICIAL/version = $JAR_VERSION/g" build.gradle.kts
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
Expand All @@ -56,8 +55,8 @@ jobs:
- name: Grant Wrapper Permission
run: chmod +x gradlew

- name: Build With Gradle
run: ./gradlew build
- name: Build Custom Version With Gradle
run: ./gradlew -P"project.version"=${{ env.JAR_VERSION}} build

- name: Upload the artifact
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {
}

group = "com.github.slimefun"
version = "4.9-UNOFFICIAL"
version = property("project.version").toString()
description = "Slimefun"

java.toolchain.languageVersion.set(JavaLanguageVersion.of(targetJavaVersion))
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Project Version
project.version=4.9-UNOFFICIAL
# Enable parallel builds
org.gradle.parallel=true
# Java version and encoding
Expand Down

0 comments on commit 0066f4e

Please sign in to comment.