diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index d32a7e1..6ac00ae 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -7,7 +7,7 @@ on: concurrency: group: "mavenCentral" cancel-in-progress: false - + env: GRADLE_OPTS: -Dorg.gradle.caching=true @@ -19,14 +19,13 @@ jobs: - name: Set environment for version run: long="${{ github.ref }}"; version=${long#"refs/tags/v"}; echo "version=${version}" >> $GITHUB_ENV - uses: actions/checkout@v3 - - uses: gradle/wrapper-validation-action@v1 - uses: gradle/gradle-build-action@v2 - name: Build with Gradle run: ./gradlew build - name: Publish run: ./gradlew -Pversion=$version -Dorg.gradle.parallel=false publish closeAndReleaseStagingRepository env: - SIGNING_PRIVATE_KEY: ${{ secrets.SIGNING_PRIVATE_KEY }} - SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} - SONARTYPE_APIKEY: ${{ secrets.SONARTYPE_APIKEY }} - SONARTYPE_APITOKEN: ${{ secrets.SONARTYPE_APITOKEN }} + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_PRIVATE_KEY }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} + ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONARTYPE_APIKEY }} + ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONARTYPE_APITOKEN }} diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 702c747..ea126b1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -17,11 +17,13 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: gradle/wrapper-validation-action@v1 - name: Dependency Review uses: actions/dependency-review-action@v3 if: github.event_name == 'pull_request' - - uses: gradle/gradle-build-action@v2 + - uses: gradle/gradle-build-action@v2 + with: + dependency-graph: generate-and-submit + gradle-home-cache-cleanup: true - name: Build with Gradle run: ./gradlew build - name: Detekt diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml index be22d58..199d54a 100644 --- a/.github/workflows/Docs.yml +++ b/.github/workflows/Docs.yml @@ -27,7 +27,6 @@ jobs: steps: - uses: actions/configure-pages@v3 - uses: actions/checkout@v3 - - uses: gradle/wrapper-validation-action@v1 - uses: gradle/gradle-build-action@v2 - name: Generate Docs run: ./gradlew :integrationTest:hashRouterTest:browserDistribution diff --git a/.github/workflows/gradleWrapper.yml b/.github/workflows/gradleWrapper.yml new file mode 100644 index 0000000..3818e1c --- /dev/null +++ b/.github/workflows/gradleWrapper.yml @@ -0,0 +1,18 @@ +name: Gradle Wrapper Validation + +on: + pull_request: + paths: + - 'gradlew' + - 'gradlew.bat' + - 'gradle/wrapper/' + +jobs: + validateWrapper: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v3 + - uses: gradle/wrapper-validation-action@v1 diff --git a/build.gradle.kts b/build.gradle.kts index 30d2f3c..c19d3d9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,19 +5,13 @@ import io.gitlab.arturbosch.detekt.* plugins { kotlin("multiplatform") version "1.8.20" id("org.jetbrains.compose") version "1.4.3" - `maven-publish` - signing + id("maven-publish") + id("signing") id("io.github.gradle-nexus.publish-plugin") version "1.3.0" id("io.gitlab.arturbosch.detekt") version "1.22.0" id("app.cash.licensee") version "1.7.0" } -repositories { - mavenCentral() - google() - maven(url = "https://maven.pkg.jetbrains.space/public/p/compose/dev") -} - kotlin { jvmToolchain(11) jvm() @@ -50,12 +44,12 @@ kotlin { } named("jsMain") { dependencies { - api(compose.web.core) + api(compose.html.core) } } named("jsTest") { dependencies { - implementation(compose.web.testUtils) + implementation(compose.html.testUtils) } } @@ -108,12 +102,11 @@ publishing { } } -(System.getProperty("signing.privateKey") ?: System.getenv("SIGNING_PRIVATE_KEY"))?.let { - String(Base64.getDecoder().decode(it)).trim() -}?.let { key -> - signing { - val signingPassword = System.getProperty("signing.password") ?: System.getenv("SIGNING_PASSWORD") - useInMemoryPgpKeys(key, signingPassword) +signing { + val signingKey: String? by project + val signingPassword: String? by project + signingKey?.let { + useInMemoryPgpKeys(String(Base64.getDecoder().decode(it)).trim(), signingPassword) sign(publishing.publications) } } @@ -124,11 +117,14 @@ tasks.withType().configureEach { dependsOn(signingTasks) } +tasks.withType().configureEach { + isPreserveFileTimestamps = false + isReproducibleFileOrder = true +} + nexusPublishing { - repositories { + this.repositories { sonatype { - username.set(System.getProperty("sonartype.apiKey") ?: System.getenv("SONARTYPE_APIKEY")) - password.set(System.getProperty("sonartype.apiToken") ?: System.getenv("SONARTYPE_APITOKEN")) nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) } diff --git a/integrationTest/browserRouterTest/build.gradle.kts b/integrationTest/browserRouterTest/build.gradle.kts index f1a0572..cf74c1a 100644 --- a/integrationTest/browserRouterTest/build.gradle.kts +++ b/integrationTest/browserRouterTest/build.gradle.kts @@ -1,16 +1,8 @@ -import org.jetbrains.compose.* - plugins { kotlin("js") id("org.jetbrains.compose") } -repositories { - mavenCentral() - google() - jetbrainsCompose() -} - kotlin { js(IR) { browser { diff --git a/integrationTest/build.gradle.kts b/integrationTest/build.gradle.kts index 5fa3fbd..12c0831 100644 --- a/integrationTest/build.gradle.kts +++ b/integrationTest/build.gradle.kts @@ -1,16 +1,8 @@ -import org.jetbrains.compose.* - plugins { kotlin("multiplatform") id("org.jetbrains.compose") } -repositories { - mavenCentral() - google() - jetbrainsCompose() -} - kotlin { jvmToolchain(11) jvm() diff --git a/settings.gradle.kts b/settings.gradle.kts index 90df249..b2393ca 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,6 +1,6 @@ pluginManagement { repositories { - maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + mavenCentral() gradlePluginPortal() } } @@ -20,6 +20,13 @@ gradleEnterprise { } } +dependencyResolutionManagement { + repositories { + mavenCentral() + google() + } +} + rootProject.name = "routing-compose" enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")