Skip to content
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
56 changes: 56 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Publish to Modrinth

on:
release:
types:
- published

permissions:
contents: read

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 25

- name: Determine previous release tag
id: prev_tag
run: |
PREV=$(git describe --tags --abbrev=0 "${{ github.event.release.tag_name }}^" 2>/dev/null || true)
echo "tag=$PREV" >> "$GITHUB_OUTPUT"

- name: Detect changed modules
if: steps.prev_tag.outputs.tag != ''
id: filter
uses: dorny/paths-filter@v3
with:
base: ${{ steps.prev_tag.outputs.tag }}
filters: |
paper:
- 'paper/**'
- 'common/**'
- 'api/**'
- 'gradle/libs.versions.toml'
- 'build.gradle.kts'
- 'settings.gradle.kts'

- name: Build all modules
run: ./gradlew build

- name: Publish Paper
if: steps.prev_tag.outputs.tag == '' || steps.filter.outputs.paper == 'true'
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CHANGELOG: ${{ github.event.release.body }}
run: ./gradlew :paper:modrinth
73 changes: 73 additions & 0 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Verify version

on:
pull_request:
branches:
- master

permissions:
contents: read

jobs:
version-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Extract versions
id: versions
run: |
set -euo pipefail
extract() {
grep -E '^[[:space:]]*version[[:space:]]*=' "$1" | head -1 \
| sed -E 's/.*"([^"]+)".*/\1/'
}

PR_VERSION=$(extract build.gradle.kts)
if [ -z "$PR_VERSION" ]; then
echo "::error file=build.gradle.kts::Could not extract version from build.gradle.kts on PR branch."
exit 1
fi

BASE_FILE=$(git show "origin/${{ github.base_ref }}:build.gradle.kts")
BASE_VERSION=$(echo "$BASE_FILE" | grep -E '^[[:space:]]*version[[:space:]]*=' | head -1 \
| sed -E 's/.*"([^"]+)".*/\1/')
if [ -z "$BASE_VERSION" ]; then
echo "::error::Could not extract version from build.gradle.kts on origin/${{ github.base_ref }}."
exit 1
fi

echo "pr=$PR_VERSION" >> "$GITHUB_OUTPUT"
echo "base=$BASE_VERSION" >> "$GITHUB_OUTPUT"
echo "PR: $PR_VERSION"
echo "Base: $BASE_VERSION"

- name: Reject 'dev' in version
run: |
PR='${{ steps.versions.outputs.pr }}'
if echo "$PR" | grep -qi 'dev'; then
echo "::error file=build.gradle.kts::Version '$PR' contains 'dev' — must not be merged."
exit 1
fi

- name: Verify version is not lower
run: |
set -euo pipefail
PR='${{ steps.versions.outputs.pr }}'
BASE='${{ steps.versions.outputs.base }}'

if [ "$PR" = "$BASE" ]; then
echo "Version unchanged ($BASE) — OK."
exit 0
fi

LOWER=$(printf '%s\n%s\n' "$PR" "$BASE" | sort -V | head -1)
if [ "$LOWER" != "$BASE" ]; then
echo "::error file=build.gradle.kts::PR version ($PR) is lower than base version ($BASE). Version must only go up."
exit 1
fi

echo "PR version $PR > base version $BASE — OK."
24 changes: 14 additions & 10 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
/*
* Copyright (c) 2026 Seedim
* This file is part of Custom Daytime, which is licensed under GPL-3.0.
* See the LICENSE file in the project root for full license text.
* Copyright (c) 2026 Seedim
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

plugins {
id("java")
}

group = "xyz.mayahive.customdaytime"
version = "2.0.0-SNAPSHOT"

repositories {
mavenCentral()
}

val javaTarget = 21 // Sponge targets a minimum of Java 21
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(javaTarget))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/*
* Copyright (c) 2026 Seedim
* This file is part of Custom Daytime, which is licensed under GPL-3.0.
* See the LICENSE file in the project root for full license text.
* Copyright (c) 2026 Seedim
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package xyz.mayahive.customdaytime.api;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/*
* Copyright (c) 2026 Seedim
* This file is part of Custom Daytime, which is licensed under GPL-3.0.
* See the LICENSE file in the project root for full license text.
* Copyright (c) 2026 Seedim
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package xyz.mayahive.customdaytime.api.model;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/*
* Copyright (c) 2026 Seedim
* This file is part of Custom Daytime, which is licensed under GPL-3.0.
* See the LICENSE file in the project root for full license text.
* Copyright (c) 2026 Seedim
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package xyz.mayahive.customdaytime.api.model;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/*
* Copyright (c) 2026 Seedim
* This file is part of Custom Daytime, which is licensed under GPL-3.0.
* See the LICENSE file in the project root for full license text.
* Copyright (c) 2026 Seedim
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package xyz.mayahive.customdaytime.api.platform;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/*
* Copyright (c) 2026 Seedim
* This file is part of Custom Daytime, which is licensed under GPL-3.0.
* See the LICENSE file in the project root for full license text.
* Copyright (c) 2026 Seedim
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package xyz.mayahive.customdaytime.api.platform;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/*
* Copyright (c) 2026 Seedim
* This file is part of Custom Daytime, which is licensed under GPL-3.0.
* See the LICENSE file in the project root for full license text.
* Copyright (c) 2026 Seedim
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package xyz.mayahive.customdaytime.api.platform;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/*
* Copyright (c) 2026 Seedim
* This file is part of Custom Daytime, which is licensed under GPL-3.0.
* See the LICENSE file in the project root for full license text.
* Copyright (c) 2026 Seedim
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package xyz.mayahive.customdaytime.api.platform;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/*
* Copyright (c) 2026 Seedim
* This file is part of Custom Daytime, which is licensed under GPL-3.0.
* See the LICENSE file in the project root for full license text.
* Copyright (c) 2026 Seedim
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package xyz.mayahive.customdaytime.api.platform;
Expand Down
24 changes: 15 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
/*
* Copyright (c) 2026 Seedim
* This file is part of Custom Daytime, which is licensed under GPL-3.0.
* See the LICENSE file in the project root for full license text.
* Copyright (c) 2026 Seedim
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

subprojects {

group = "xyz.mayahive.customdaytime"
version = "2.1.0"

repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
version = "2.1.1"

if (name != "api") {
plugins.withId("java") {
Expand Down
Loading
Loading