diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 56d750ec..c7496d88 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -12,7 +12,7 @@ jobs: SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASSWORD }}' GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' # Set environment - env: 'prod' + ENV: 'prod' steps: # Checkout the Code - name: Checkout Code diff --git a/.github/workflows/gradle-test.yml b/.github/workflows/gradle-test.yml index 7714fff0..aec15815 100644 --- a/.github/workflows/gradle-test.yml +++ b/.github/workflows/gradle-test.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest # Set up environment variables env: - env: 'local' # Set to local, so it won't deploy the jar to the repos + ENV: 'local' # Set to local, so it won't deploy the jar to the repos steps: # Checkout code - name: Checkout Code diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f2980f5..cceb06e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## v0.6.2 - Snapshot +* Improved .env loader +* Fixed "ENV" variable to be uppercase +* Fixed dokkaJavadocJar task dependency +* Fixed CHANGELOG.md + +## v0.6.1 - Snapshot +* Added Maven Central Repository +* Updated SECURITY.md + ## v0.6.0 - Snapshot * Added Standalone support * Improved velocity SoftwareType check diff --git a/build.gradle.kts b/build.gradle.kts index 0f7c95ad..7a8d6830 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,21 +11,11 @@ plugins { id("org.jetbrains.dokka") version "1.7.20" } -val env = emptyMap().toMutableMap() -env.putAll(System.getenv()) -if(project.rootProject.file(".env").exists()) { - env.putAll( - project.rootProject - .file(".env") - .inputStream() - .bufferedReader() - .readLines() - .filter { it.isNotBlank() && !it.startsWith("#") } - .map { it.split("=") } - .associate { it[0] to it[1] } - ) -} -val projectVersion = env["VERSION"] ?: "0.6.1-SNAPSHOT" +val env = project.rootProject.file(".env").let { file -> + if(file.exists()) file.readLines().filter { it.isNotBlank() && !it.startsWith("#") && it.split("=").size == 2 }.associate { it.split("=")[0] to it.split("=")[1] } else emptyMap() +}.toMutableMap().apply { putAll(System.getenv()) } + +val projectVersion = env["VERSION"] ?: "0.6.2-SNAPSHOT" group = "xyz.theprogramsrc" version = projectVersion.replaceFirst("v", "").replace("/", "") @@ -44,7 +34,7 @@ repositories { } dependencies { - compileOnly("org.spigotmc:spigot-api:1.19.2-R0.1-SNAPSHOT") + compileOnly("org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT") compileOnly("net.md-5:bungeecord-api:1.19-R0.1-SNAPSHOT") compileOnly("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT") @@ -130,14 +120,14 @@ configurations { } val dokkaJavadocJar by tasks.register("dokkaJavadocJar") { - dependsOn(tasks.dokkaJavadoc) + dependsOn(tasks.dokkaJavadoc, tasks.dokkaHtml) from(tasks.dokkaJavadoc.flatMap { it.outputDirectory }) archiveClassifier.set("javadoc") } publishing { repositories { - if (env["env"] == "prod") { + if (env["ENV"] == "prod") { if (env.containsKey("GITHUB_ACTOR") && env.containsKey("GITHUB_TOKEN")) { maven { name = "GithubPackages"