Skip to content

Commit

Permalink
Migrate to new Shipkit plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Feb 9, 2021
1 parent 2645756 commit 320052d
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 75 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
steps:
- name: Check out repo
uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Wait on builds
uses: lewagon/wait-on-check-action@v0.1-beta.2
with:
Expand All @@ -25,17 +27,13 @@ jobs:
- name: Perform release
uses: eskatos/gradle-command-action@v1
env:
# shipkit does not support GitHub Actions for now, hence that we simulate to be Travis CI
TRAVIS_BRANCH: master
TRAVIS_COMMIT_MESSAGE: <no commit message, not needed, we do not care about them, if we trigger or not>
TRAVIS_PULL_REQUEST: false
GH_WRITE_TOKEN: ${{ secrets.GH_WRITE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BINTRAY_USER_NAME: ${{ secrets.BINTRAY_USER_NAME }}
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
NEXUS_TOKEN_USERNAME: ${{ secrets.NEXUS_TOKEN_USERNAME }}
NEXUS_TOKEN_PASSWORD: ${{ secrets.NEXUS_TOKEN_PASSWORD }}
with:
arguments: ciPerformRelease
arguments: bintrayUpload githubRelease
- name: Trigger website build
uses: peter-evans/repository-dispatch@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Thank you for your efforts! 🙏
The least we can do is to thank them and list some of their accomplishments here (in lexicographic order).

#### 2021

* [Slawomir Jaranowski](https://github.com/slawekjaranowski) Migrate to new Shipkit plugins (#410 / #419)
* [Stefano Cordio](https://github.com/scordio) contributed [the Cartesian Enum source](https://junit-pioneer.org/docs/cartesian-product/#cartesianenumsource) (#379 / #409)

#### 2020
Expand Down
108 changes: 106 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ plugins {
checkstyle
`maven-publish`
id("com.diffplug.spotless") version "5.8.2"
id("org.shipkit.java") version "2.3.1"
id("at.zierler.yamlvalidator") version "1.5.0"
id("org.sonarqube") version "3.1.1"
id("org.moditect.gradleplugin") version "1.0.0-rc3"
id("org.shipkit.shipkit-auto-version") version "1.1.1"
id("org.shipkit.shipkit-changelog") version "1.1.4"
id("org.shipkit.shipkit-github-release") version "1.1.1"
id("com.jfrog.bintray") version "1.8.5"
}

plugins.withType<JavaPlugin>().configureEach {
Expand All @@ -19,6 +22,11 @@ plugins.withType<JavaPlugin>().configureEach {
group = "org.junit-pioneer"
description = "JUnit 5 Extension Pack"

// used in pom and bintray
val issueTracker = "https://github.com/junit-pioneer/junit-pioneer/issues"
val scm = "https://github.com/junit-pioneer/junit-pioneer.git"
val website = "https://junit-pioneer.org/"

val modularBuild = findProperty("modularBuild") != null;

java {
Expand All @@ -27,7 +35,8 @@ java {
} else {
sourceCompatibility = JavaVersion.VERSION_1_8
}

withJavadocJar()
withSourcesJar()
}

repositories {
Expand Down Expand Up @@ -116,6 +125,87 @@ moditect {
}
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])

// additional pom content
pom {
name.set(project.name)
description.set(project.description)
url.set(website)

licenses {
license {
name.set("Eclipse Public License v2.0")
url.set("https://www.eclipse.org/legal/epl-v20.html")
}
}

scm {
url.set(scm)
}

issueManagement {
system.set("GitHub Issues")
url.set(issueTracker)
}

ciManagement {
system.set("GitHub Actions")
url.set("https://github.com/junit-pioneer/junit-pioneer/actions")
}

developers {
mapOf(
"nicolaiparlog" to "Nicolai Parlog",
"smoyer64" to "Steve Moyer",
"Bukama" to "Matthias Bünger",
"aepfli" to "Simon Schrottner",
"Michael1993" to "Mihály Verhás"
).forEach {
developer {
id.set(it.key)
name.set(it.value)
url.set("https://github.com/" + it.key)
}
}
}
}
}
}
}

bintray {
setPublications("maven")
dryRun = project.hasProperty("bintrayDryRun")
user = System.getenv("BINTRAY_USER_NAME")
key = System.getenv("BINTRAY_API_KEY")
publish = true

pkg.apply {
userOrg = "junit-pioneer" // https://bintray.com/junit-pioneer
repo = "junit-pioneer" // https://bintray.com/junit-pioneer/junit-pioneer
name = "junit-pioneer" // https://bintray.com/junit-pioneer/junit-pioneer/junit-pioneer
description = project.description
githubRepo = "https://github.com/junit-pioneer/junit-pioneer"
issueTrackerUrl = issueTracker
vcsUrl = scm
websiteUrl = website
setLicenses("EPL-2.0")
setLabels("testing", "junit", "extensions")

version.apply {
mavenCentralSync.apply {
sync = true
user = System.getenv("NEXUS_TOKEN_USERNAME")
password = System.getenv("NEXUS_TOKEN_PASSWORD")
}
}
}
}

tasks {

sourceSets {
Expand Down Expand Up @@ -179,4 +269,18 @@ tasks {
}
}

generateChangelog {
previousRevision = ext.get("shipkit-auto-version.previous-tag").toString()
githubToken = System.getenv("GITHUB_TOKEN")
repository = "junit-pioneer/junit-pioneer"
}

githubRelease {
dependsOn(generateChangelog)
val generateChangelogTask = generateChangelog.get()
repository = generateChangelogTask.repository
changelog = generateChangelogTask.outputFile
githubToken = generateChangelogTask.githubToken
newTagRevision = System.getenv("GITHUB_SHA")
}
}
62 changes: 0 additions & 62 deletions gradle/shipkit.gradle

This file was deleted.

7 changes: 3 additions & 4 deletions version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#Version of the produced binaries. This file is intended to be checked-in.
#It will be automatically bumped by release automation.
version=1.3.1
previousVersion=1.3.0
# Version of produced binaries.
# The '*' part is automatically resolved by shipkit-auto-version Gradle plugin (https://github.com/shipkit/shipkit-auto-version).
version=1.3.*

0 comments on commit 320052d

Please sign in to comment.