-
Notifications
You must be signed in to change notification settings - Fork 19
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
Showing
21 changed files
with
377 additions
and
121 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | ||
|
||
name: Deploy to central | ||
|
||
on: workflow_dispatch | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/gradle.yml | ||
deploy: | ||
needs: build | ||
strategy: | ||
matrix: | ||
include: | ||
- target: publishKotlinMultiplatformPublicationToSonatypeRepository | ||
os: macos-latest | ||
- target: publishIosArm64PublicationToSonatypeRepository | ||
os: macos-latest | ||
- target: publishIosSimulatorArm64PublicationToSonatypeRepository | ||
os: macos-latest | ||
- target: publishAndroidDebugPublicationToSonatypeRepository | ||
os: ubuntu-latest | ||
- target: publishAndroidReleasePublicationToSonatypeRepository | ||
os: ubuntu-latest | ||
- target: publishJvmPublicationToSonatypeRepository | ||
os: ubuntu-latest | ||
- target: publishLinuxX64PublicationToSonatypeRepository | ||
os: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.konan | ||
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }} | ||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
with: | ||
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | ||
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Gradle publish | ||
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 | ||
with: | ||
arguments: | | ||
${{ matrix.target }} | ||
closeSonatypeStagingRepository | ||
-Psigning.gnupg.passphrase=${{secrets.OSSRH_GPG_SECRET_KEY_PASSWORD}} | ||
-Psigning.gnupg.keyName=${{secrets.OSSRH_GPG_SECRET_KEY_ID}} | ||
-PsonatypeUsername=${{secrets.OSSRH_USERNAME}} | ||
-PsonatypePassword=${{secrets.OSSRH_PASSWORD}} | ||
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,52 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | ||
|
||
name: Java CI with Gradle | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_call: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
include: | ||
- target: iosSimulatorArm64Test | ||
os: macos-latest | ||
- target: jvmTest | ||
os: ubuntu-latest | ||
- target: linuxX64Test | ||
os: ubuntu-latest | ||
- target: testDebugUnitTest | ||
os: ubuntu-latest | ||
- target: testReleaseUnitTest | ||
os: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.konan | ||
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }} | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Build with Gradle | ||
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 | ||
with: | ||
arguments: ${{ matrix.target }} |
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,3 +1,6 @@ | ||
/.idea/ | ||
/build/ | ||
/.gradle/ | ||
/convention-plugins/.gradle/ | ||
/convention-plugins/build/ | ||
.envrc |
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,11 @@ | ||
plugins { | ||
`kotlin-dsl` // Is needed to turn our build logic written in Kotlin into the Gradle Plugin | ||
} | ||
|
||
repositories { | ||
gradlePluginPortal() // To use 'maven-publish' and 'signing' plugins in our own plugin | ||
} | ||
|
||
dependencies { | ||
implementation("io.github.gradle-nexus.publish-plugin:io.github.gradle-nexus.publish-plugin.gradle.plugin:2.0.0-rc-1") | ||
} |
64 changes: 64 additions & 0 deletions
64
convention-plugins/src/main/kotlin/convention.publication.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,64 @@ | ||
import org.gradle.api.publish.maven.MavenPublication | ||
import org.gradle.api.tasks.bundling.Jar | ||
import org.gradle.kotlin.dsl.`maven-publish` | ||
import org.gradle.kotlin.dsl.signing | ||
|
||
plugins { | ||
`maven-publish` | ||
signing | ||
id("io.github.gradle-nexus.publish-plugin") | ||
} | ||
|
||
|
||
val javadocJar by tasks.registering(Jar::class) { | ||
archiveClassifier.set("javadoc") | ||
} | ||
|
||
nexusPublishing { | ||
// Configure maven central repository | ||
repositories { | ||
sonatype() | ||
} | ||
|
||
|
||
// Configure all publications | ||
} | ||
|
||
publishing { | ||
publications.withType<MavenPublication> { | ||
// Stub javadoc.jar artifact | ||
artifact(javadocJar.get()) | ||
|
||
// Provide artifacts information requited by Maven Central | ||
pom { | ||
name.set("Dummy Kotlin Multiplatform library") | ||
description.set("Dummy library to test deployment to Maven Central") | ||
url.set("https://github.com/asm0dey/dummylib-multiplatform") | ||
|
||
licenses { | ||
license { | ||
name.set("MIT") | ||
url.set("https://opensource.org/licenses/MIT") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("asm0dey") | ||
name.set("Pasha Finkelshteyn") | ||
email.set("asm0dey@jetbrains.com") | ||
} | ||
} | ||
scm { | ||
url.set("https://github.com/asm0dey/dummylib-multiplatform") | ||
} | ||
} | ||
} | ||
} | ||
|
||
val gpgKeyId by extra { System.getenv("secrets.OSSRH_GPG_SECRET_KEY_ID") } | ||
val gpgKey by extra { System.getenv("secrets.OSSRH_GPG_SECRET_KEY") } | ||
val gpgKeyPassword by extra { System.getenv("secrets.OSSRH_GPG_SECRET_KEY_PASSWORD") } | ||
signing { | ||
useGpgCmd() | ||
sign(publishing.publications) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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.