Skip to content

Commit 5f16161

Browse files
committed
Add a release task
1 parent 1f841b9 commit 5f16161

File tree

3 files changed

+57
-6
lines changed

3 files changed

+57
-6
lines changed

.github/workflows/release.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build and Publish Release
2+
on:
3+
push:
4+
branches: [ master, main ]
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up JDK 21
14+
uses: actions/setup-java@v4
15+
with:
16+
java-version: '21'
17+
distribution: 'temurin'
18+
cache: gradle
19+
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
20+
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
21+
- name: Setup Gradle
22+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
23+
# build
24+
- name: Build with Gradle Wrapper
25+
run: ./gradlew assemble
26+
27+
- name: Get version
28+
id: version
29+
run: echo "version=$(./gradlew echoVersion)" >> $env:GITHUB_OUTPUT
30+
- name: Get releaseName
31+
id: releaseName
32+
run: echo "releaseName=$(./gradlew echoReleaseName)" >> $env:GITHUB_OUTPUT
33+
34+
- name: Create Release
35+
id: createRelease
36+
uses: softprops/action-gh-release@v2
37+
with:
38+
files: build/libs/Underilla-Spigot-${{ steps.version.outputs.version }}.jar
39+
token: ${{ secrets.GITHUB_TOKEN }}
40+
tag_name: ${{ steps.version.outputs.version }}
41+
name: ${{ steps.releaseName.outputs.releaseName }}
42+
body_path: CHANGELOG.md
43+
prerelease: true

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ If you want to remove some of the game features, for example the `monster_room`
140140
It can also be used to add feature to some biome. For example a quartz_ore feature if your nether is disabled you you still want your builder to have quartz.
141141
142142
## Build
143-
Create a working jar with `./gradlew buildDependents`
143+
Create a working jar with `./gradlew assemble`
144144
145145
## TODO
146146
- Build-in pre-generation system.

Underilla-Spigot/build.gradle.kts

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
plugins {
22
`java-library`
33
id("io.github.goooler.shadow") version "8.1.7"
4-
id("io.papermc.paperweight.userdev") version "2.0.0-beta.8" // paperweight // Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev
4+
// paperweight.userdev 2.0.0-beta.8 isn't working to have a Underilla-Spigot-1.6.9.jar which is the reobf jar.
5+
id("io.papermc.paperweight.userdev") version "1.7.7" // paperweight // Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev
56
`maven-publish` // Add ./gradlew publishToMavenLocal
67
id("xyz.jpenilla.run-paper") version "2.3.1"
78
}
89

910
group = "com.jkantrell.mc.underilla.spigot"
10-
version = "1.6.8"
11+
version = "1.6.10"
1112
description="Generate vanilla cave in custom world."
12-
val mainMinecraftVersion = "1.21.4"
13+
val mainMinecraftVersion = "1.21.3"
1314
val supportedMinecraftVersions = "[1.21.3 - 1.21.4]"
1415

1516
repositories {
@@ -24,7 +25,7 @@ repositories {
2425

2526
dependencies {
2627
// compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT") // without paperweight
27-
paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT") // paperweight
28+
paperweight.paperDevBundle("$mainMinecraftVersion-R0.1-SNAPSHOT")
2829
implementation("com.jkantrell:Yamlizer:main-SNAPSHOT")
2930
implementation(project(":Underilla-Core"))
3031
implementation("fr.formiko.mc.biomeutils:biomeutils:1.1.8")
@@ -75,7 +76,7 @@ tasks {
7576
// Configure the Minecraft version for our task.
7677
// This is the only required configuration besides applying the plugin.
7778
// Your plugin's jar (or shadowJar if present) will be used automatically.
78-
minecraftVersion("1.21.4")
79+
minecraftVersion(mainMinecraftVersion)
7980
// https://hangar.papermc.io/pop4959/Chunky
8081
downloadPlugins {
8182
hangar("Chunky", "1.4.28")
@@ -92,6 +93,13 @@ publishing {
9293
// Break Yamlizer.
9394
// paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
9495

96+
97+
tasks.register("echoVersion") {
98+
doLast {
99+
println("${project.version}")
100+
}
101+
}
102+
95103
tasks.register("echoReleaseName") {
96104
doLast {
97105
println("${project.version} ${supportedMinecraftVersions}")

0 commit comments

Comments
 (0)