Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GradleUtils for versioning #28

Merged
merged 7 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ jobs:

steps:
- name: 'Checkout repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 100
fetch-tags: true

- name: 'Set up JDK 17'
uses: actions/setup-java@v3
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ jobs:

steps:
- name: 'Checkout repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 100
fetch-tags: true

- name: 'Set up JDK 17'
uses: actions/setup-java@v3
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ jobs:

steps:
- name: 'Checkout repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 100
fetch-tags: true

- name: 'Set up JDK 17'
uses: actions/setup-java@v3
Expand Down
11 changes: 4 additions & 7 deletions Changelog/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import se.bjurr.gitchangelog.api.InclusivenessStrategy
import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask

plugins {
id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' version '1.+'
}

var tag = 'git tag'.execute().text.split('\n').reverse()[1]

tasks.register('makeHtmlChangelog', GitChangelogTask) {
fromRepo = projectDir.absolutePath.toString()
file = file('changelog.html')

fromRevisionStrategy = InclusivenessStrategy.INCLUSIVE

fromRevision = "git rev-list ${'git describe --tags --abbrev=0'.execute().text.trim()}..HEAD --reverse".execute().text.split('\n').first().trim()
fromRevision = tag
toRevision = 'HEAD'

templateContent = file('templates/changelog-html.mustache').getText()
Expand All @@ -21,9 +20,7 @@ tasks.register('makeMarkdownChangelog', GitChangelogTask) {
fromRepo = projectDir.absolutePath.toString()
file = file('changelog.md')

fromRevisionStrategy = InclusivenessStrategy.INCLUSIVE

fromRevision = "git rev-list ${'git describe --tags --abbrev=0'.execute().text.trim()}..HEAD --reverse".execute().text.split('\n').first().trim()
fromRevision = tag
toRevision = 'HEAD'

templateContent = file('templates/changelog-markdown.mustache').getText()
Expand Down
13 changes: 11 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
plugins {
id 'net.darkhax.curseforgegradle' version '1.0.+' apply false
id 'com.modrinth.minotaur' version '2.+' apply false

id 'net.neoforged.gradleutils' version '3.+'
}

apply from: 'buildtools/ColoredOutput.gradle'

println "Starting build of $mod_name, Version: $mod_version"
gradleutils.version {
tags {
label = 'beta'
appendCommitOffset = false
}
}

println "Starting build of $mod_name, Version: ${gradleutils.version.toString()}"

subprojects {
version = mod_version
version = gradleutils.version.toString()
group = "hantonik.$mod_id"

tasks.withType(ProcessResources).configureEach {
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ org.gradle.jvmargs = -Xmx4G -Xms4G
org.gradle.parallel = true

# Mod Properties
mod_version = 5.2.1.0-beta
mod_id = anvilapi
mod_name = AnvilAPI

Expand Down