-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
814774e
commit ea736e1
Showing
13 changed files
with
251 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env kotlin | ||
|
||
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:0.47.0") | ||
|
||
import io.github.typesafegithub.workflows.actions.actions.CheckoutV3 | ||
import io.github.typesafegithub.workflows.actions.gradle.GradleBuildActionV2 | ||
import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest | ||
import io.github.typesafegithub.workflows.domain.triggers.PullRequest | ||
import io.github.typesafegithub.workflows.domain.triggers.Push | ||
import io.github.typesafegithub.workflows.dsl.expressions.expr | ||
import io.github.typesafegithub.workflows.dsl.workflow | ||
import io.github.typesafegithub.workflows.yaml.writeToFile | ||
|
||
workflow( | ||
name = "Publish Kotlin AWS CDK DSL to Maven Central", | ||
on = listOf(Push(tags = listOf("*"))), | ||
sourceFile = __FILE__.toPath(), | ||
env = linkedMapOf( | ||
"ORG_GRADLE_PROJECT_signingKey" to expr("secrets.SIGNING_KEY"), | ||
"ORG_GRADLE_PROJECT_signingPassword" to expr("secrets.SIGNING_PASSWORD"), | ||
"ORG_GRADLE_PROJECT_sonatypeUsername" to expr("secrets.SONATYPEUSERNAME"), | ||
"ORG_GRADLE_PROJECT_sonatypePassword" to expr("secrets.SONATYPEPASSWORD"), | ||
), | ||
) { | ||
job(id = "build", runsOn = UbuntuLatest) { | ||
uses(name = "checkout", action = CheckoutV3()) | ||
uses(name = "build", action = GradleBuildActionV2( | ||
gradleVersion = "wrapper", | ||
gradleHomeCacheCleanup = true, | ||
gradleHomeCacheIncludes = listOf("jdks", "caches", "notifications"), | ||
arguments = "publishToSonatype --info --stacktrace" | ||
)) | ||
} | ||
}.writeToFile() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# This file was generated using Kotlin DSL (.github/workflows/publish.main.kts). | ||
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file. | ||
# Generated with https://github.com/typesafegithub/github-workflows-kt | ||
|
||
name: 'Publish Kotlin AWS CDK DSL to Maven Central' | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
env: | ||
ORG_GRADLE_PROJECT_signingKey: '${{ secrets.SIGNING_KEY }}' | ||
ORG_GRADLE_PROJECT_signingPassword: '${{ secrets.SIGNING_PASSWORD }}' | ||
ORG_GRADLE_PROJECT_sonatypeUsername: '${{ secrets.SONATYPEUSERNAME }}' | ||
ORG_GRADLE_PROJECT_sonatypePassword: '${{ secrets.SONATYPEPASSWORD }}' | ||
jobs: | ||
check_yaml_consistency: | ||
name: 'Check YAML consistency' | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- id: 'step-0' | ||
name: 'Check out' | ||
uses: 'actions/checkout@v3' | ||
- id: 'step-1' | ||
name: 'Execute script' | ||
run: 'rm ''.github/workflows/publish.yaml'' && ''.github/workflows/publish.main.kts''' | ||
- id: 'step-2' | ||
name: 'Consistency check' | ||
run: 'git diff --exit-code ''.github/workflows/publish.yaml''' | ||
build: | ||
runs-on: 'ubuntu-latest' | ||
needs: | ||
- 'check_yaml_consistency' | ||
steps: | ||
- id: 'step-0' | ||
name: 'checkout' | ||
uses: 'actions/checkout@v3' | ||
- id: 'step-1' | ||
name: 'build' | ||
uses: 'gradle/gradle-build-action@v2' | ||
with: | ||
gradle-version: 'wrapper' | ||
gradle-home-cache-includes: |- | ||
jdks | ||
caches | ||
notifications | ||
arguments: 'publishToSonatype --info --stacktrace' | ||
gradle-home-cache-cleanup: 'true' |
49 changes: 49 additions & 0 deletions
49
build-logic/src/main/kotlin/cloudshift/awscdkdsl/build/library-publishing.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package cloudshift.awscdkdsl.build | ||
|
||
plugins { | ||
`maven-publish` | ||
signing | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("mavenJava") { | ||
from(components["java"]) | ||
|
||
pom { | ||
name.set("awscdk-dsl-kotlin") | ||
description.set("Kotlin DSL for AWS CDK") | ||
url.set("https://github.com/cloudshiftinc/awscdk-dsl-kotlin") | ||
|
||
licenses { | ||
license { | ||
name.set("Apache License, version 2.0") | ||
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
} | ||
|
||
scm { | ||
connection.set("scm:git:git://github.com/cloudshiftinc/awscdk-dsl-kotlin.git/") | ||
developerConnection.set("scm:git:ssh://github.com:cloudshiftinc/awscdk-dsl-kotlin.git") | ||
url.set("https://github.com/cloudshiftinc/awscdk-dsl-kotlin") | ||
} | ||
|
||
developers { | ||
developer { | ||
id.set("cloudshiftchris") | ||
name.set("Chris Lee") | ||
email.set("[email protected]") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
val signingKey : String? by project | ||
val signingPassword: String? by project | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
sign(publishing.publications["mavenJava"]) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
|
||
plugins { | ||
id("cloudshift.awscdkdsl.build.kotlin-library") | ||
id("cloudshift.awscdkdsl.build.library-publishing") | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
|
||
plugins { | ||
id("cloudshift.awscdkdsl.build.kotlin-library") | ||
id("cloudshift.awscdkdsl.build.library-publishing") | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.