-
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.
Merge pull request #1 from takahirom/takahirom/prepare-for-release/20…
…24-07-30 Prepare for release
- Loading branch information
Showing
15 changed files
with
274 additions
and
6 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,68 @@ | ||
name: Deploy to central | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- '**' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/gradle.yml | ||
deploy: | ||
environment: | ||
name: release | ||
needs: build | ||
strategy: | ||
matrix: | ||
include: | ||
- target: publishIosArm64PublicationToSonatypeRepository --no-configuration-cache | ||
os: macos-latest | ||
- target: publishIosX64PublicationToSonatypeRepository --no-configuration-cache | ||
os: macos-latest | ||
- target: publishAndroidReleasePublicationToSonatypeRepository --no-configuration-cache | ||
os: ubuntu-latest | ||
- target: publishIosSimulatorArm64PublicationToSonatypeRepository --no-configuration-cache | ||
os: macos-latest | ||
- target: publishJvmPublicationToSonatypeRepository --no-configuration-cache | ||
os: ubuntu-latest | ||
# - target: publishLinuxX64PublicationToSonatypeRepository | ||
# os: ubuntu-latest | ||
- target: publishKotlinMultiplatformPublicationToSonatypeRepository --no-configuration-cache | ||
os: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- 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: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
- name: Run Gradle publish | ||
run: | | ||
./gradlew \ | ||
${{ matrix.target }} \ | ||
closeSonatypeStagingRepository \ | ||
-PsonatypeUsername='${{ secrets.OSSRH_USERNAME }}' \ | ||
-PsonatypePassword='${{ secrets.OSSRH_PASSWORD }}' \ | ||
-PtestSecret='${{ secrets.TEST_SECRET }}' \ | ||
-Psigning.gnupg.passphrase='${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}' \ | ||
-Psigning.gnupg.keyName='${{ secrets.OSSRH_GPG_SECRET_KEY_ID }}' | ||
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,50 @@ | ||
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: testReleaseUnitTest | ||
# os: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- 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@ce999babab2de1c4b649dc15f0ee67e6246c994f | ||
with: | ||
arguments: ${{ matrix.target }} | ||
- name: Upload Test Report | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: test-results-${{ matrix.target }} | ||
path: '**/build/test-results/**' |
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 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
plugins { | ||
id("root.publication") | ||
alias(libs.plugins.android.application) apply false | ||
alias(libs.plugins.android.library) apply false | ||
alias(libs.plugins.jetbrains.kotlin.jvm) apply false | ||
alias(libs.plugins.jetbrains.kotlin.multiplatform) apply false | ||
} |
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 @@ | ||
/build |
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,8 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
dependencies { | ||
implementation(libs.nexus.publish) | ||
implementation(libs.bundles.plugins) | ||
} |
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,21 @@ | ||
pluginManagement { | ||
repositories { | ||
google() | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
dependencyResolutionManagement { | ||
repositories { | ||
google() | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
|
||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} |
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,26 @@ | ||
import org.gradle.api.Project | ||
import org.gradle.api.artifacts.ExternalModuleDependencyBundle | ||
import org.gradle.api.artifacts.MinimalExternalModuleDependency | ||
import org.gradle.api.artifacts.VersionCatalog | ||
import org.gradle.api.artifacts.VersionCatalogsExtension | ||
import org.gradle.kotlin.dsl.getByType | ||
import org.gradle.plugin.use.PluginDependency | ||
|
||
internal val Project.libs: VersionCatalog | ||
get() = extensions.getByType<VersionCatalogsExtension>().named("libs") | ||
|
||
internal fun VersionCatalog.version(name: String): String { | ||
return findVersion(name).get().requiredVersion | ||
} | ||
|
||
internal fun VersionCatalog.library(name: String): MinimalExternalModuleDependency { | ||
return findLibrary(name).get().get() | ||
} | ||
|
||
internal fun VersionCatalog.plugin(name: String): PluginDependency { | ||
return findPlugin(name).get().get() | ||
} | ||
|
||
internal fun VersionCatalog.bundle(name: String): ExternalModuleDependencyBundle { | ||
return findBundle(name).get().get() | ||
} |
49 changes: 49 additions & 0 deletions
49
convention-plugins/src/main/kotlin/module.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,49 @@ | ||
import org.gradle.api.publish.maven.MavenPublication | ||
import org.gradle.api.tasks.bundling.Jar | ||
import org.gradle.kotlin.dsl.`maven-publish` | ||
|
||
plugins { | ||
`maven-publish` | ||
signing | ||
} | ||
|
||
publishing { | ||
// Configure all publications | ||
publications.withType<MavenPublication> { | ||
// Stub javadoc.jar artifact | ||
artifact(tasks.register("${name}JavadocJar", Jar::class) { | ||
archiveClassifier.set("javadoc") | ||
archiveAppendix.set(this@withType.name) | ||
}) | ||
|
||
// Provide artifacts information required by Maven Central | ||
pom { | ||
name.set("RoboSpec") | ||
description.set("This library enhances Compose Multiplatform by enabling the use of `rememberRetained{}`, which is stored within ViewModel. It broadens the versatility of Compose, allowing it to be utilized in a wider array of contexts and scenarios.") | ||
url.set("https://github.com/takahirom/robospec") | ||
|
||
licenses { | ||
license { | ||
name.set("Apache License 2.0") | ||
url.set("https://opensource.org/licenses/Apache-2.0.html") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("takahirom") | ||
name.set("takahirom") | ||
} | ||
} | ||
scm { | ||
url.set("https://github.com/takahirom/robospec") | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
if (project.hasProperty("signing.gnupg.keyName")) { | ||
useGpgCmd() | ||
sign(publishing.publications) | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
convention-plugins/src/main/kotlin/root.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,19 @@ | ||
plugins { | ||
id("io.github.gradle-nexus.publish-plugin") | ||
} | ||
|
||
allprojects { | ||
group = "io.github.takahirom.robospec" | ||
version = "0.0.1" | ||
} | ||
|
||
nexusPublishing { | ||
// Configure maven central repository | ||
// https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-ossrh | ||
repositories { | ||
sonatype { //only for users registered in Sonatype after 24 Feb 2021 | ||
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) | ||
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) | ||
} | ||
} | ||
} |
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,9 +1,22 @@ | ||
plugins { | ||
alias(libs.plugins.jetbrains.kotlin.jvm) | ||
alias(libs.plugins.jetbrains.kotlin.multiplatform) | ||
id("module.publication") | ||
} | ||
|
||
dependencies { | ||
compileOnly(libs.coroutines) | ||
testImplementation(libs.coroutines) | ||
testImplementation(libs.junit) | ||
kotlin { | ||
jvm() | ||
sourceSets { | ||
val commonMain by getting { | ||
dependencies { | ||
compileOnly(libs.coroutines) | ||
} | ||
} | ||
val jvmTest by getting { | ||
dependencies { | ||
implementation(libs.coroutines) | ||
implementation(libs.junit) | ||
} | ||
} | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,4 +1,5 @@ | ||
pluginManagement { | ||
includeBuild("convention-plugins") | ||
repositories { | ||
google { | ||
content { | ||
|