Skip to content

Commit

Permalink
Merge pull request #98 from MineInAbyss/develop
Browse files Browse the repository at this point in the history
Build against 1.20, cleanup workflows
  • Loading branch information
0ffz authored Jun 20, 2023
2 parents 11d1650 + 9970c3f commit 2368c62
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 71 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Java CI

on:
push:
branches:
- master
paths-ignore:
- '**.md'
pull_request:

concurrency:
cancel-in-progress: true
group: ci-${{ github.ref }}

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -21,14 +20,5 @@ jobs:
java-version: 17
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build
- name: Run build
run: gradle build

- name: Upload build
uses: actions/upload-artifact@v1
with:
name: build
path: build/libs
37 changes: 7 additions & 30 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- develop
paths-ignore:
- '**.md'

Expand All @@ -14,34 +15,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
- uses: MineInAbyss/publish-action@master
with:
distribution: temurin
java-version: 17

- name: Set env variable from latest maven version
run: >
echo "RELEASE_VERSION=$( \
curl https://repo.mineinabyss.com/releases/com/mineinabyss/deeperworld/maven-metadata.xml | \
grep -oP '(?!<latest>)[\d\.]*(?=</latest>)' \
)" >> $GITHUB_ENV
- name: Run gradle build and publish
run: gradle build publish -PmineinabyssMavenUsername=${{ secrets.MAVEN_PUBLISH_USERNAME }} -PmineinabyssMavenPassword=${{ secrets.MAVEN_PUBLISH_PASSWORD }}

- name: Get version from gradle
shell: bash
id: extract_version
run: |
version=`gradle properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}'`
echo "::set-output name=version::$version"
- name: Create GitHub Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
automatic_release_tag: v${{ steps.extract_version.outputs.version }}
files: |
build/libs/*-all.jar
maven-metadata-url: https://repo.mineinabyss.com/releases/com/mineinabyss/deeperworld/maven-metadata.xml
maven-username: ${{ secrets.MAVEN_PUBLISH_USERNAME }}
maven-password: ${{ secrets.MAVEN_PUBLISH_PASSWORD }}
release-files: |
${{ github.workspace }}/publish/*.jar
7 changes: 3 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
val idofrontVersion: String by project

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id("com.mineinabyss.conventions.kotlin")
alias(libs.plugins.kotlinx.serialization)
id("com.mineinabyss.conventions.kotlin.jvm")
id("com.mineinabyss.conventions.papermc")
id("com.mineinabyss.conventions.copyjar")
id("com.mineinabyss.conventions.publication")
id("com.mineinabyss.conventions.testing")
id("com.mineinabyss.conventions.autoversion")
kotlin("plugin.serialization")
}

repositories {
Expand Down
6 changes: 2 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
group=com.mineinabyss
version=0.7
kotlinVersion=1.7.20
serverVersion=1.19.2-R0.1-SNAPSHOT
idofrontVersion=0.15.3
version=0.8
idofrontVersion=0.18.14
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
13 changes: 5 additions & 8 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ pluginManagement {
maven("https://repo.papermc.io/repository/maven-public/") //Paper
}

plugins {
val kotlinVersion: String by settings
id("org.jetbrains.kotlin.jvm") version kotlinVersion
id("org.jetbrains.kotlin.plugin.serialization") version kotlinVersion
}

val idofrontVersion: String by settings
resolutionStrategy.eachPlugin {
if (requested.id.id.startsWith("com.mineinabyss.conventions")) useVersion(idofrontVersion)
resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith("com.mineinabyss.conventions"))
useVersion(idofrontVersion)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.mineinabyss.deeperworld.world.section.correspondingLocation
import com.mineinabyss.deeperworld.world.section.correspondingSection
import com.mineinabyss.deeperworld.world.section.getCorrespondingLocation
import com.mineinabyss.deeperworld.world.section.section
import com.mineinabyss.idofront.commands.CommandHolder
import com.mineinabyss.idofront.commands.arguments.booleanArg
import com.mineinabyss.idofront.commands.arguments.intArg
import com.mineinabyss.idofront.commands.execution.IdofrontCommandExecutor
Expand All @@ -35,7 +34,7 @@ import org.bukkit.command.CommandSender
import org.bukkit.command.TabCompleter

class DeeperCommandExecutor : IdofrontCommandExecutor(), TabCompleter {
override val commands: CommandHolder = commands(deeperWorld) {
override val commands = commands(deeperWorld) {
("deeperworld" / "dw") {
"reload" {
action {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import org.bukkit.block.data.type.Bed
import org.bukkit.block.data.type.Sapling
import org.bukkit.block.data.type.Stairs
import org.bukkit.block.data.type.TrapDoor
import org.bukkit.block.sign.Side
import org.bukkit.entity.EntityType
import org.bukkit.event.EventHandler
import org.bukkit.event.EventPriority
Expand Down Expand Up @@ -70,7 +71,8 @@ object SectionSyncListener : Listener {

//sync any changes to BlockLocker's signs`
if (DeeperContext.isBlockLockerLoaded && state is Sign &&
state.lines().first() == Component.text("[Private]")) {
(state.getSide(Side.FRONT).lines().first() == Component.text("[Private]")
|| state.getSide(Side.BACK).lines().first() == Component.text("[Private]"))) {
syncBlockLocker(corr)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import org.bukkit.Material
import org.bukkit.block.Block
import org.bukkit.block.Sign
import org.bukkit.block.data.BlockData
import org.bukkit.block.sign.Side
import org.bukkit.inventory.ItemStack
import org.bukkit.util.Vector

Expand Down Expand Up @@ -41,11 +42,11 @@ internal inline fun Location.sync(updater: (original: Block, corresponding: Bloc
internal fun signUpdater(lines: MutableList<Component>? = null) = { original: Block, corresponding: Block ->
copyBlockData(original, corresponding)
val sign = original.state
if (sign is Sign) {
val readLines = lines ?: sign.lines()
if (sign is Sign) for (side in Side.values()) {
val readLines = lines ?: sign.getSide(side).lines()
val corrSign = corresponding.state
if (corrSign is Sign && !corrSign.lines().containsAll(readLines)) {
readLines.forEachIndexed { i, line -> corrSign.line(i, line) }
if (corrSign is Sign && !corrSign.getSide(side).lines().containsAll(readLines)) {
readLines.forEachIndexed { i, line -> corrSign.getSide(side).line(i, line) }
corrSign.update()
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: DeeperWorld
version: ${plugin_version}
main: com.mineinabyss.deeperworld.DeeperWorldPlugin
authors: [Derongan, Offz, Boy000, Norazan, Scyu]
api-version: '1.17'
api-version: '1.20'
description: A plugin for letting you create a deeper world. Or at least fake it.

softdepend: [Multiverse-Core, BlockLocker, KotlinSpice, ProtocolLib, FastAsyncWorldEdit]
softdepend: [Multiverse-Core, BlockLocker, ProtocolLib, FastAsyncWorldEdit]

commands:
deeperworld:
Expand Down

0 comments on commit 2368c62

Please sign in to comment.