diff --git a/.github/release.yml b/.github/release.yml index e06efa4..c87f004 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,28 +1,27 @@ changelog: exclude: categories: - - title: "Breaking changes :warning:" + - title: "โš ๏ธ Breaking changes" labels: - "status: breaking" - - title: "Additions :sparkles:" + - title: "โœจ Additions" labels: - "type: feature" - - "type: enhancement" - - title: "Bug fixes :bug:" + - title: "๐Ÿ› Fixes" labels: - "type: bug: fix" - - title: "Improvements :wrench:" + - title: "๐Ÿ”ง Improvements" labels: + - "type: enhancement" - "type: refactor" - - title: "Documentation :book:" + - "type: performance" + - "type: removal" + - title: "๐Ÿ“– Documentation" labels: - "type: documentation" - - title: "Test coverage :test_tube:" + - title: "๐Ÿงช Test coverage" labels: - "type: test" - - title: "Dependency updates" - labels: - - "type: dependencies" - - title: "Other" + - title: "โš™๏ธ Other" labels: - "*" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 440d014..0000000 --- a/.github/renovate.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended", - ":semanticCommits", - ":semanticPrefixChore", - ":semanticCommitScope(deps)", - ":enableVulnerabilityAlerts" - ], - "labels": [ - "type: dependencies" - ], - "assigneesFromCodeOwners": true, - "configMigration": true -} diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 0000000..24f8396 --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,6 @@ +{ + $schema: 'https://docs.renovatebot.com/renovate-schema.json', + extends: [ + 'github>HyperaDev/actions', + ], +} diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 6617474..908fd8b 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,60 +1,18 @@ -# GitHub Action workflow to run Gradle tasks. +# GitHub Actions workflow to build a Gradle project. name: "Gradle" - on: push: - branches: [ "main" ] + branches: [ "main", "releases/**" ] + tags-ignore: ["**"] pull_request: branches: [ "main" ] - schedule: - - cron: "25 6 * * 5" - -concurrency: - group: "${{ github.workflow }}-${{ github.event.number || github.ref }}" - cancel-in-progress: true - -env: - JAVA_VERSION: 17 + merge_group: jobs: - validate: - name: "Validate" - runs-on: "ubuntu-latest" - permissions: read-all - steps: - - name: "Checkout repository" - uses: actions/checkout@v3 - - name: "Validate Gradle wrapper" - uses: gradle/wrapper-validation-action@v1 - build: name: "Build" - runs-on: "ubuntu-latest" - needs: "validate" - permissions: - actions: read - contents: read - security-events: write - strategy: - fail-fast: false - steps: - - name: "Checkout repository" - uses: actions/checkout@v3 - - - name: "Set up JDK ${{ env.JAVA_VERSION }}" - uses: actions/setup-java@v3 - with: - java-version: "${{ env.JAVA_VERSION }}" - distribution: "adopt" - - - name: "Build" - uses: gradle/gradle-build-action@v2 - with: - arguments: "build" - - - name: "Upload artifacts" - uses: actions/upload-artifact@v3 - with: - retention-days: 14 - if-no-files-found: ignore - path: build/libs/UltraStaffChat-*.jar + uses: HyperaDev/actions/.github/workflows/gradle-build.yml@main + with: + codecov_enabled: false + upload_artifacts: | + build/libs/UltraStaffChat-*.jar diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 046e8f6..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: "Publish" -on: - push: - branches: [ "main" ] - -concurrency: - group: "${{ github.workflow }}" - cancel-in-progress: true - -env: - JAVA_VERSION: 17 - -jobs: - release: - name: "Release" - runs-on: "ubuntu-latest" - steps: - - name: "Checkout repository" - uses: actions/checkout@v3 - - - name: "Set up JDK ${{ env.JAVA_VERSION }}" - uses: actions/setup-java@v3 - with: - java-version: "${{ env.JAVA_VERSION }}" - distribution: "adopt" - - - name: "Determine version" - run: | - echo "VERSION=$(./gradlew properties | awk '/^version:/ { print $2; }')" >> $GITHUB_ENV - - - name: "Import GPG key" - uses: crazy-max/ghaction-import-gpg@v5.3.0 - with: - gpg_private_key: "${{ secrets.GPG_PRIVATE_KEY }}" - - - name: "Gradle publish" - uses: gradle/gradle-build-action@v2 - with: - arguments: "build publish" - env: - ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}" - ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}" - ORG_GRADLE_PROJECT_hyperaReleasesUsername: "${{ secrets.HYPERA_RELEASES_USERNAME }}" - ORG_GRADLE_PROJECT_hyperaReleasesPassword: "${{ secrets.HYPERA_RELEASES_PASSWORD }}" - ORG_GRADLE_PROJECT_hyperaSnapshotsUsername: "${{ secrets.HYPERA_SNAPSHOTS_USERNAME }}" - ORG_GRADLE_PROJECT_hyperaSnapshotsPassword: "${{ secrets.HYPERA_SNAPSHOTS_PASSWORD }}" - - - name: "Create release" - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - updateOnlyUnreleased: true - generateReleaseNotes: true - name: "UltraStaffChat v${{ env.VERSION }}" - prerelease: "${{ endsWith(env.VERSION, 'SNAPSHOT') }}" - tag: "v${{ env.VERSION }}" - artifacts: "build/libs/UltraStaffChat-*.jar" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ef837f2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,20 @@ +# GitHub Actions workflow to publish releases. +# Releases are published from the 'releases/' branches. +name: "Release" +on: + push: + branches: [ "releases/**" ] + +jobs: + release: + name: "Release" + uses: HyperaDev/actions/.github/workflows/gradle-release.yml@main + secrets: + HYPERA_SIGNING_KEY: "${{ secrets.GPG_PRIVATE_KEY }}" + HYPERA_SIGNING_PASSWORD: "${{ secrets.GPG_PASSPHRASE }}" + HYPERA_RELEASES_USERNAME: "${{ secrets.HYPERA_RELEASES_USERNAME }}" + HYPERA_RELEASES_PASSWORD: "${{ secrets.HYPERA_RELEASES_PASSWORD }}" + with: + project_name: "UltraStaffChat" + release_files: | + build/libs/UltraStaffChat-*.jar diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000..ec19430 --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,15 @@ +# GitHub Actions workflow to publish unstable snapshots. +# Snapshots are published from the 'main' branch, and should always be considered +# unstable and unfit for production usage. +name: "Snapshot" +on: + push: + branches: [ "main" ] + +jobs: + snapshot: + name: "Snapshot" + uses: HyperaDev/actions/.github/workflows/gradle-snapshot.yml@main + secrets: + HYPERA_SNAPSHOTS_USERNAME: "${{ secrets.HYPERA_SNAPSHOTS_USERNAME }}" + HYPERA_SNAPSHOTS_PASSWORD: "${{ secrets.HYPERA_SNAPSHOTS_PASSWORD }}" diff --git a/build-logic/src/main/kotlin/ultrastaffchat.publishing.gradle.kts b/build-logic/src/main/kotlin/ultrastaffchat.publishing.gradle.kts index 74cf7fc..c3d90ed 100644 --- a/build-logic/src/main/kotlin/ultrastaffchat.publishing.gradle.kts +++ b/build-logic/src/main/kotlin/ultrastaffchat.publishing.gradle.kts @@ -26,6 +26,7 @@ indra { ci(true) } + signWithKeyFromPrefixedProperties("hypera") publishReleasesTo("hyperaReleases", "https://repo.hypera.dev/releases") publishSnapshotsTo("hyperaSnapshots", "https://repo.hypera.dev/snapshots") diff --git a/build.gradle.kts b/build.gradle.kts index 3cedd15..e61c0f9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,15 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -@Suppress( // https://youtrack.jetbrains.com/issue/KTIJ-19369/ - "DSL_SCOPE_VIOLATION", - "MISSING_DEPENDENCY_CLASS", - "UNRESOLVED_REFERENCE_WRONG_RECEIVER", - "FUNCTION_CALL_EXPECTED" -) plugins { id("ultrastaffchat.common") - alias(libs.plugins.indra.sonatype) alias(libs.plugins.shadow) java } @@ -48,10 +41,6 @@ dependencies { compileOnly(libs.annotations) } -indraSonatype { - useAlternateSonatypeOSSHost("s01") -} - java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 84150c8..3086822 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ version = "1.0" [versions] # Adventure adventure = "4.14.0" -adventure-platform = "4.3.0" +adventure-platform = "4.3.1" # Platforms platform-bungeecord = "1.20-R0.1-SNAPSHOT" @@ -14,11 +14,11 @@ updatelib = "4.0.0" bstats = "3.0.2" # Code safety -annotations = "24.0.1" +annotations = "24.1.0" # Build -build-indra = "3.1.2" -build-errorprone = "2.20.0" +build-indra = "3.1.3" +build-errorprone = "2.23.0" build-errorprone-plugin = "3.1.0" build-shadow = "8.1.1" @@ -45,5 +45,4 @@ build-errorprone-core = { module = "com.google.errorprone:error_prone_core", ver build-errorprone-annotations = { module = "com.google.errorprone:error_prone_annotations", version.ref = "build-errorprone" } [plugins] -indra-sonatype = { id = "net.kyori.indra.publishing.sonatype", version.ref = "build-indra" } shadow = { id = "com.github.johnrengelman.shadow", version.ref = "build-shadow" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a7..7f93135 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f28c329..1af9e09 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,25 +1,7 @@ -# -# This file is a part of UltraStaffChat (https://github.com/HyperaDev/UltraStaffChat). -# -# Copyright (C) 2021-2023 The UltraStaffChat Authors. -# -# 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 . -# - distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cb..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \