From 6173df08cae59701b7017eea8e0a6658c45bb620 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 8 May 2024 17:53:49 +0200 Subject: [PATCH] Add Metaborg publication --- Jenkinsfile | 5 +++++ build.gradle.kts | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index d9f7157..b16c163 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,6 +9,11 @@ gradlePipeline( gradleBuildTasks: "build", gradlePublishTasks: "publish", + // Releases + releaseTagPattern: "release-*.*.*", + publishUsernameProperty: "metaborg-artifacts.username", + publishPasswordProperty: "metaborg-artifacts.password", + // Slack slack: true, slackChannel: "#spoofax3-dev" diff --git a/build.gradle.kts b/build.gradle.kts index 44ee344..459faa9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import java.net.URI + // Workaround for issue: https://youtrack.jetbrains.com/issue/KTIJ-19369 @Suppress("DSL_SCOPE_VIOLATION") plugins { @@ -10,6 +12,8 @@ plugins { group = "org.metaborg" +description = "A Git-based versioning plugin for Gradle." +extra["isReleaseVersion"] = !version.toString().endsWith("-SNAPSHOT") repositories { mavenCentral() @@ -38,6 +42,8 @@ configure { } gradlePlugin { + website.set("https://github.com/metaborg/gitonium") + vcsUrl.set("https://github.com/metaborg/gitonium") plugins { create("gitonium") { id = "org.metaborg.gitonium" @@ -84,6 +90,18 @@ publishing { } } } + repositories { + maven { + val releasesRepoUrl = uri("https://artifacts.metaborg.org/content/repositories/releases/") + val snapshotsRepoUrl = uri("https://artifacts.metaborg.org/content/repositories/snapshots/") + name = "MetaborgArtifacts" + url = if (project.extra["isReleaseVersion"] as Boolean) releasesRepoUrl else snapshotsRepoUrl + credentials { + username = project.findProperty("metaborg-artifacts.username") as String? + password = project.findProperty("metaborg-artifacts.password") as String? + } + } + } }