do beta versioning on gh action builds

This commit is contained in:
Wagyourtail 2022-06-01 15:49:41 -06:00
parent 17a2aa42e9
commit b0266cd14b
No known key found for this signature in database
GPG Key ID: 919725C5A647667A
3 changed files with 34 additions and 2 deletions

View File

@ -19,7 +19,21 @@ jobs:
with:
java-version: '8'
distribution: 'adopt'
- uses: actions/github-script@v2
id: fname
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 => e.trim().startsWith("mod_version") ? `${e}-beta-${process.env.GITHUB_SHA.substring(0, 7)}` : e).join("\n");
fs.writeFileSync("./gradle.properties", file);
const mod_version = file.toString().split("\n").filter(e => e.trim().startsWith("mod_version"))[0].split("=")[1].trim();
const archives_base_name = file.toString().split("\n").filter(e => e.trim().startsWith("archives_base_name"))[0].split("=")[1].trim();
return `${archives_base_name}-${mod_version}`;
- name: Grant execute permission for gradlew
run: chmod +x gradlew

View File

@ -16,7 +16,7 @@
*/
group 'baritone'
version '1.2.15'
version project.mod_version
buildscript {
repositories {

18
gradle.properties Normal file
View File

@ -0,0 +1,18 @@
#
# This file is part of Baritone.
#
# Baritone is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Baritone is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Baritone. If not, see <https://www.gnu.org/licenses/>.
#
mod_version = 1.2.15