Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CI #307

Merged
merged 3 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
concurrency:
group: "mavenCentral"
cancel-in-progress: false

env:
GRADLE_OPTS: -Dorg.gradle.caching=true

Expand All @@ -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 }}
6 changes: 4 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/Docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/gradleWrapper.yml
Original file line number Diff line number Diff line change
@@ -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
34 changes: 15 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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)
}
}
Expand All @@ -124,11 +117,14 @@ tasks.withType<AbstractPublishToMaven>().configureEach {
dependsOn(signingTasks)
}

tasks.withType<AbstractArchiveTask>().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/"))
}
Expand Down
8 changes: 0 additions & 8 deletions integrationTest/browserRouterTest/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import org.jetbrains.compose.*

plugins {
kotlin("js")
id("org.jetbrains.compose")
}

repositories {
mavenCentral()
google()
jetbrainsCompose()
}

kotlin {
js(IR) {
browser {
Expand Down
8 changes: 0 additions & 8 deletions integrationTest/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import org.jetbrains.compose.*

plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
}

repositories {
mavenCentral()
google()
jetbrainsCompose()
}

kotlin {
jvmToolchain(11)
jvm()
Expand Down
9 changes: 8 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pluginManagement {
repositories {
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
mavenCentral()
gradlePluginPortal()
}
}
Expand All @@ -20,6 +20,13 @@ gradleEnterprise {
}
}

dependencyResolutionManagement {
repositories {
mavenCentral()
google()
}
}

rootProject.name = "routing-compose"

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
Expand Down