Skip to content

Commit

Permalink
Update versioning and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Roadhog360 committed Nov 4, 2024
1 parent f67fa88 commit 8c43332
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: Build and test
name: Build without test

on:
pull_request:
Expand All @@ -9,5 +9,5 @@ on:

jobs:
build-and-test:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
uses: Roadhog360/Hog-Actions-Workflows/.github/workflows/build-without-test.yml@master
secrets: inherit
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ Current incompatibility todo:
- Iguana Tinker Tweaks heads are not 3D in inventory
- Tinkers' Construct gold upgrade heads are not 3D in inventory
- HEE's enderman head is not 3D in inventory
- Gaia Guardian head is not 3D in inventory
32 changes: 32 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
//version: 1707058017

plugins {
id 'com.gtnewhorizons.gtnhconvention'
id 'com.palantir.git-version'
}

// The planned name of the next release
def NEXT_VERSION = ext.modVersion

// Append to the version as needed. If the variables look a bit strange, that's because they are -
// git-version doesn't expose a ton of useful functions, we need to extract them indirectly.

// If we have a clean tag (or manually specified), this is a production release.
// No need for the commit hash!
def details = versionDetails()
def isPlainTag = details.getCommitDistance() == 0
def noCommitHash = providers.gradleProperty("noCommitHash").isPresent()
if (!isPlainTag && !noCommitHash) {
NEXT_VERSION += "-nightly-" + details.gitHash
}

// If we have uncommitted changes, say so.
def isDirty = gitVersion().endsWith(".dirty")
if (isDirty && !noCommitHash) {
NEXT_VERSION += "-dirty"
}

//Set the mod and jar version to the info we just collected.
version = NEXT_VERSION

minecraft {
//Creates a tag in Tags with the above generated mod version, instead of the "clean" one
injectedTags.put("RAW_VERSION", NEXT_VERSION)
injectedTags.put("MOD_ID", project.modId)
}
5 changes: 5 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#We don't (entirely) use git versioning so we override it here to make some tweaks to the way version numbers are defined.
gtnh.modules.gitVersion = false
#Planned name for next release
modVersion = 0.0.0

# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
# LOCAL to test local config updates.
gtnh.settings.blowdryerTag = 0.2.2
Expand Down

0 comments on commit 8c43332

Please sign in to comment.