Skip to content

Commit

Permalink
Migrate to new Shipkit plugins (#419)
Browse files Browse the repository at this point in the history
Migrate to new Shipkit plugins (#410 / #419)

Shipkit is deprecated and the GitHub project[1] is archived. They
write:

> "One Shipkit Gradle plugin to rule them all" approach has proven
> hard to maintain for the team. We [have] converted Shipkit into a
> narrow set of small libraries (design note[2]). Several customers,
> inclu[d]ing Mockito project have already migrated.

More preecisely, Shipkit was split into these projects:

* shipkit-auto-version[3]
* shipkit-changelog[4]
* shipkit-github-release (no source on GitHub?)

This change updates the build accordingly.

Closes: #410
Maybe solves: #256 (can't be determined without a release build)
PR: #419

[1]: https://github.com/mockito/shipkit
[2]: https://github.com/mockito/shipkit/blob/master/docs/design-specs/future-shipkit.md
[3]: https://github.com/shipkit/shipkit-auto-version
[4]: https://github.com/shipkit/shipkit-changelog
  • Loading branch information
slawekjaranowski committed Feb 28, 2021
1 parent 569d2b3 commit 2986c20
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 76 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
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ This also triggers a website build - [see its `README.md`](https://github.com/ju

### Versioning

Shipkit manages versions by reading from and writing to [`version-properties`](version.properties):
On each build, it releases the version specified by the `version` field and then increases its patch level for the next release.
Shipkit manages versions by reading from [`version-properties`](version.properties):
The variable `version` defines a _major_ and _minor_ version and leaves _patch_ undetermined (e.g. `1.3.*`), so Shipkit can pick the next version.

This is how JUnit Pioneer handles versioning:

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ The least we can do is to thank them and list some of their accomplishments here
#### 2021

* [Daniel Kraus](https://github.com/beatngu13) fixed a bug in `AbstractEntryBasedExtension` (#432)
* [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.9.0"
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 2986c20

Please sign in to comment.