From 4dba5a4399f6691fdf5401b88492a0b0c2d15610 Mon Sep 17 00:00:00 2001 From: Wagyourtail Date: Fri, 3 Jun 2022 14:09:37 -0600 Subject: [PATCH] use `git describe` instead --- .github/workflows/gradle_build.yml | 20 +------------------- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/gradle_build.yml b/.github/workflows/gradle_build.yml index 98c6f5fee..0af2ebbc1 100644 --- a/.github/workflows/gradle_build.yml +++ b/.github/workflows/gradle_build.yml @@ -20,29 +20,11 @@ jobs: java-version: '8' distribution: 'adopt' - - uses: actions/github-script@v2 - name: apply beta versioning - with: - result-encoding: string - script: | - const fs = require("fs"); - let file = fs.readFileSync("./gradle.properties"); - file = file.toString().split("\n").map(e => { - if (!e.trim().startsWith("mod_version")) return e; - if (process.env.GITHUB_REF.includes("tags")) return e; - let vers = e.split("."); - let n = parseInt(vers[vers.length-1].trim()) + 1; - vers = vers.slice(0, vers.length - 1); - vers.push(n); - return `${vers.join(".")}-beta-${process.env.GITHUB_SHA.substring(0, 7)}`; - }).join("\n"); - fs.writeFileSync("./gradle.properties", file); - - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew build + run: ./gradlew build -Pmod_version=$(git describe --always --tags | cut -c2-) - name: Archive Artifacts uses: actions/upload-artifact@v2 diff --git a/gradle.properties b/gradle.properties index ca675d85d..dfce2934c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,4 @@ # along with Baritone. If not, see . # -mod_version = 1.2.15 \ No newline at end of file +mod_version = 1.2.15-local_build \ No newline at end of file