Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
24 changes: 24 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

categories:
- title: 'Features'
labels:
- 'enhancement'
- title: 'Bug Fixes'
labels:
- 'bug'
- title: 'Maintenance'
labels:
- 'dependencies'
- 'documentation'

change-template: '- $TITLE (#$NUMBER) @$AUTHOR'
Comment thread
Cinnazeyy marked this conversation as resolved.
change-title-escapes: '\<*_&'

template: |
## What's Changed

$CHANGES

**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
41 changes: 41 additions & 0 deletions .github/workflows/release-draft.yml
Comment thread
num0001 marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Update Release Draft

on:
push:
branches: [main]

permissions:
contents: write
pull-requests: read

jobs:
update-draft:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true

- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Compute next release version
id: version
run: |
NEXT="$(./gradlew -q printNextReleaseVersion)"
echo "next=${NEXT}" >> "$GITHUB_OUTPUT"

- name: Update release draft
uses: release-drafter/release-drafter@v6
with:
version: ${{ steps.version.outputs.next }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Attach Release Artifacts

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
ref: ${{ github.event.release.tag_name }}

- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build with Gradle Wrapper
run: ./gradlew clean build

- name: Attach shaded JAR to release
uses: softprops/action-gh-release@v2
with:
files: build/libs/*.jar
fail_on_unmatched_files: true
14 changes: 9 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
java
alias(libs.plugins.git.version)
alias(libs.plugins.git.semver)
alias(libs.plugins.shadow)
}

Expand Down Expand Up @@ -61,11 +61,8 @@ dependencies {
compileOnly(libs.io.papermc.paper.paper.api)
}

val versionDetails: groovy.lang.Closure<com.palantir.gradle.gitversion.VersionDetails> by extra
val details = versionDetails()

group = "com.alpsbte"
version = "5.0.3" + "-" + details.gitHash + "-SNAPSHOT"
version = semver.semVersion
description = "An easy to use building system for the BuildTheEarth project."
java.sourceCompatibility = JavaVersion.VERSION_21

Expand All @@ -92,6 +89,13 @@ tasks.jar {
enabled = false // Disable the default jar task since we are using shadowJar
}

tasks.register("printNextReleaseVersion") {
val nextRelease = semver.version.toString().removeSuffix("-SNAPSHOT")
doLast {
println(nextRelease)
}
}

tasks.processResources {
// work around IDEA-296490
duplicatesStrategy = DuplicatesStrategy.INCLUDE
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ org-mariadb-jdbc-mariadb-java-client = "3.5.7" # https://central.sonatype.com/a
com-intellectualsites-bom-bom-newest = "1.55" # Ref: https://github.com/IntellectualSites/bom
# Plugins
shadow = "9.3.1" # https://github.com/GradleUp/shadow/releases
git-version = "5.0.0" # https://github.com/palantir/gradle-git-version/releases
git-semver = "0.19.0" # https://github.com/jmongard/Git.SemVersioning.Gradle/releases

[libraries]
com-alpsbte-alpslib-alpslib-hologram = { module = "com.alpsbte.alpslib:alpslib-hologram", version.ref = "com-alpsbte-alpslib-alpslib-hologram" }
Expand All @@ -41,5 +41,5 @@ org-mariadb-jdbc-mariadb-java-client = { module = "org.mariadb.jdbc:mariadb-java
com-intellectualsites-bom-bom-newest = { module = "com.intellectualsites.bom:bom-newest", version.ref = "com-intellectualsites-bom-bom-newest" }

[plugins]
git-version = { id = "com.palantir.git-version", version.ref = "git-version" }
git-semver = { id = "com.github.jmongard.git-semver-plugin", version.ref = "git-semver" }
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }