Skip to content

Commit 70e2ed3

Browse files
committed
Shipkit release test
1 parent fd82f77 commit 70e2ed3

File tree

5 files changed

+30
-14
lines changed

5 files changed

+30
-14
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
uses: actions/setup-java@v1
3636
with:
3737
java-version: ${{ matrix.jdk }}
38-
- run: chmod +x gradlew
3938
- run: ./gradlew build --stacktrace --warning-mode all
4039

4140
release:
@@ -45,6 +44,7 @@ jobs:
4544
if: github.event_name == 'push'
4645
&& github.ref == 'refs/heads/main'
4746
&& github.repository == 'MinimallyCorrect/JavaTransformer'
47+
&& !contains(toJSON(github.event.commits.*.message), '[skip ci]')
4848
&& !contains(toJSON(github.event.commits.*.message), '[skip release]')
4949

5050
steps:
@@ -59,11 +59,9 @@ jobs:
5959
java-version: 11
6060

6161
- name: Build and publish to github
62-
run: ./gradlew -P releasing publish publishPlugins githubRelease -s
62+
run: ./gradlew -P releasing build publish githubRelease -s
6363
env:
6464
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
65-
GRADLE_PUBLISH_KEY: ${{secrets.GRADLE_PUBLISH_KEY}}
66-
GRADLE_PUBLISH_SECRET: ${{secrets.GRADLE_PUBLISH_SECRET}}
6765
DEPLOYMENT_REPO_URL_RELEASE: ${{secrets.DEPLOYMENT_REPO_URL_RELEASE}}
6866
DEPLOYMENT_REPO_URL_SNAPSHOT: ${{secrets.DEPLOYMENT_REPO_URL_SNAPSHOT}}
6967
DEPLOYMENT_REPO_USERNAME: ${{secrets.DEPLOYMENT_REPO_USERNAME}}

build.gradle.kts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
plugins {
2+
id("base")
23
id("java")
34
id("java-library")
45
id("maven-publish")
5-
id("dev.minco.gradle.defaults-plugin") version "0.2.4"
6+
id("dev.minco.gradle.defaults-plugin") version "0.2.8"
7+
id("org.shipkit.shipkit-auto-version") version "1.1.1"
8+
id("org.shipkit.shipkit-changelog") version "1.1.4"
9+
id("org.shipkit.shipkit-github-release") version "1.1.4"
610
}
711

812
apply(from = "properties.gradle")
13+
apply(from = "$rootDir/gradle/shipkit.gradle")
14+
15+
val releasing = project.hasProperty("releasing")
16+
if (!releasing) {
17+
version = "$version-SNAPSHOT"
18+
}
919

1020
repositories {
1121
exclusiveContent {
@@ -21,9 +31,8 @@ repositories {
2131
mavenCentral()
2232
}
2333

24-
minimallyCorrectDefaults {
25-
configureProject(project)
26-
}
34+
minimallyCorrectDefaults.languageLevel = JavaVersion.VERSION_11
35+
minimallyCorrectDefaults.configureProject(project)
2736

2837
dependencies {
2938
testImplementation("junit:junit:4.13.2")

gradle/shipkit.gradle

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1-
// Auto-generated by https://github.com/MinimallyCorrect/DefaultsPlugin
1+
tasks.named("mincoGenerateChangelog") {
2+
version.value("" + project.version)
3+
githubUrl.value(project.ext["githubUrl"] as String)
4+
outputFile.fileValue(project.file("$buildDir/changelog.md"))
5+
fromRevision.value(project.ext["shipkit-auto-version.previous-tag"] as String)
6+
}
27

3-
minimallyCorrectDefaultsShipkit {} ()
8+
tasks.named("githubRelease") {
9+
def genTask = tasks.named("mincoGenerateChangelog").get()
10+
dependsOn(genTask)
11+
repository = project.ext["githubOwnerProject"] as String
12+
changelog = genTask.outputFile.get().getAsFile()
13+
newTagRevision = System.getenv("GITHUB_SHA")
14+
githubToken = System.getenv("GITHUB_TOKEN")
15+
}

properties.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@ ext.githubOwnerProject = "${ext.githubOwner}/${ext.githubProject}".toString()
1010
ext.githubUrl = "https://github.com/${ext.githubOwnerProject}".toString()
1111
ext.website = ext.githubUrl
1212
ext.vcsUrl = "${ext.githubUrl}.git".toString()
13-
14-
System.setProperty("gradle.publish.key", System.getenv("GRADLE_PUBLISH_KEY") ?: "")
15-
System.setProperty("gradle.publish.secret", System.getenv("GRADLE_PUBLISH_SECRET") ?: "")

version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#Version of the produced binaries. This file is intended to be checked-in.
22
#It will be automatically bumped by release automation.
3-
version=1.9.x
3+
version=1.9.*

0 commit comments

Comments
 (0)