Skip to content

Commit

Permalink
Publishing Action Github
Browse files Browse the repository at this point in the history
  • Loading branch information
Shabinder committed May 28, 2024
1 parent 4c74b7b commit 70bc258
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 19 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
on:
[workflow_dispatch]

jobs:
create_staging_repository:
runs-on: ubuntu-latest
name: Create staging repository
outputs:
repository_id: ${{ steps.create.outputs.repository_id }}
steps:
- id: create
uses: nexus-actions/[email protected]
with:
base_url: https://s01.oss.sonatype.org/service/local/
description: ${{ github.repository }}/${{ github.workflow }}#${{ github.run_number }}
username: ${{ secrets.NEXUS_ACTIONS_SONATYPE_USERNAME }}
password: ${{ secrets.NEXUS_ACTIONS_SONATYPE_PASSWORD }}
staging_profile_id: ${{ secrets.NEXUS_ACTIONS_SONATYPE_PROFILE_ID }}

macos:
runs-on: macos-latest
needs: create_staging_repository
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure JDK
uses: actions/setup-java@v1
with:
java-version: 14
- name: Publish
run: |
./gradlew publishAllPublicationsToMavenRepository -PSONATYPE_REPOSITORY_ID=${{ needs.create_staging_repository.outputs.repository_id }}
env:
MANUAL_REPOSITORY: ${{ secrets.MANUAL_REPOSITORY }}
SONATYPE_REPOSITORY_ID: ${{ needs.create_staging_repository.outputs.repository_id }}
SONATYPE_USERNAME: ${{ secrets.NEXUS_ACTIONS_SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.NEXUS_ACTIONS_SONATYPE_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.NEXUS_ACTIONS_GPG_PRIVATE_KEY }}
GPG_PRIVATE_PASSWORD: ${{ secrets.NEXUS_ACTIONS_GPG_PRIVATE_PASSWORD }}

windows:
runs-on: windows-latest
needs: create_staging_repository
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure JDK
uses: actions/setup-java@v1
with:
java-version: 14
- name: Publish
run: |
./gradlew publishMingwX64PublicationToMavenRepository -PSONATYPE_REPOSITORY_ID=${{ needs.create_staging_repository.outputs.repository_id }}
env:
MANUAL_REPOSITORY: ${{ secrets.MANUAL_REPOSITORY }}
SONATYPE_REPOSITORY_ID: ${{ needs.create_staging_repository.outputs.repository_id }}
SONATYPE_USERNAME: ${{ secrets.NEXUS_ACTIONS_SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.NEXUS_ACTIONS_SONATYPE_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.NEXUS_ACTIONS_GPG_PRIVATE_KEY }}
GPG_PRIVATE_PASSWORD: ${{ secrets.NEXUS_ACTIONS_GPG_PRIVATE_PASSWORD }}

finalize:
runs-on: ubuntu-latest
needs: [create_staging_repository,macos,windows]
if: ${{ always() && needs.create_staging_repository.result == 'success' }}
steps:
- name: Discard
if: ${{ needs.macos.result != 'success' || needs.windows.result != 'success' }}
uses: nexus-actions/drop-nexus-staging-repo@main
with:
username: ${{ secrets.NEXUS_ACTIONS_SONATYPE_USERNAME }}
password: ${{ secrets.NEXUS_ACTIONS_SONATYPE_PASSWORD }}
staging_repository_id: ${{ needs.create_staging_repository.outputs.repository_id }}
- name: Release
if: ${{ needs.macos.result == 'success' && needs.windows.result == 'success' }}
uses: nexus-actions/release-nexus-staging-repo@main
with:
base_url: https://s01.oss.sonatype.org/service/local/
username: ${{ secrets.NEXUS_ACTIONS_SONATYPE_USERNAME }}
password: ${{ secrets.NEXUS_ACTIONS_SONATYPE_PASSWORD }}
staging_repository_id: ${{ needs.create_staging_repository.outputs.repository_id }}
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ afterEvaluate {
}
}

val String.byProperty: String? get() = gradleLocalProperties(rootDir).getProperty(this) ?: project.findProperty(this) as? String ?: System.getenv(this)
val String.byProperty: String? get() = gradleLocalProperties(rootDir, providers).getProperty(this) ?: project.findProperty(this) as? String ?: System.getenv(this)
35 changes: 18 additions & 17 deletions gradle/deps.versions.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
[versions]
kotlin = "1.9.23"
jbCompose = "1.6.1"
androidGradle = "8.0.2"
androidGradle = "8.4.0"
androidCoroutines = "1.8.0"
ktLint = "11.5.1"
mosaic = "0.8.0"
koin = "3.5.3"
koin = "3.5.6"
kermit = "2.0.2"
ktor = "2.3.9"
kotlinxSerialization = "1.6.3"
sqlDelight = "2.0.2"
sqliteJdbcDriver = "3.45.3.0"
composeWebView = "1.9.0"
sqlDelight = "2.0.1"
sqliteJdbcDriver = "3.45.2.0"
composeWebView = "1.9.8"
slf4j = "1.7.36"
i18n4k = "0.7.1"
cache4k = "0.11.0"
decompose = "3.0.0-alpha09"
essenty = "2.0.0-alpha07"
decompose = "3.0.0"
essenty = "2.0.0"
multiplatformSettings = "1.1.1"
mviKotlin = "3.3.0"
accompanist = "0.34.0"
statelyVersion = "2.0.7"
statelyIsoVersion = "2.0.0-rc1"
androidxLifecycle = "2.7.0"
androidxLifecycle = "2.8.0"
androidxMedia3 = "1.3.1"
okio = "3.9.0"
arrow = "1.2.1"
arrow = "1.2.4"
paging = "3.3.0-alpha02-0.4.0"
konnection = "1.3.0"
zipline = "1.10.0-LEGACY"
Expand All @@ -44,12 +44,12 @@ kotlin-kotlinTestCommon = { group = "org.jetbrains.kotlin", name = "kotlin-test-
kotlin-kotlinTestJs = { group = "org.jetbrains.kotlin", name = "kotlin-test-js", version.ref = "kotlin" }
kotlin-kotlinTestJunit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin" }
kotlin-kotlinTestAnnotationsCommon = { group = "org.jetbrains.kotlin", name = "kotlin-test-annotations-common", version.ref = "kotlin" }
kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version = "1.7.3" }
kotlinx-coroutinesGuava = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-guava", version = "1.7.3" }
kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version = "1.8.0" }
kotlinx-coroutinesGuava = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-guava", version = "1.8.0" }
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerialization" }
kotlinx-atomicfu = { group = "org.jetbrains.kotlinx", name = "atomicfu", version = "0.22.0" }
kotlinx-atomicfu = { group = "org.jetbrains.kotlinx", name = "atomicfu", version = "0.24.0" }
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version = "0.5.0" }
kotlinx-immutableLists = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version = "0.3.5" }
kotlinx-immutableLists = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version = "0.3.7" }

kotlin-compose-gradle = { group = "org.jetbrains.compose", name = "compose-gradle-plugin", version.ref = "jbCompose" }
mosaic-gradle = { group = "com.jakewharton.mosaic", name = "mosaic-gradle-plugin", version.ref = "mosaic" }
Expand Down Expand Up @@ -133,9 +133,9 @@ koin-test = { group = "io.insert-koin", name = "koin-test", version.ref = "koin"
koin-android = { group = "io.insert-koin", name = "koin-android", version.ref = "koin" }
koin-androidx-compose = { group = "io.insert-koin", name = "koin-androidx-compose", version.ref = "koin" }

androidx-activity = { group = "androidx.activity", name = "activity-compose", version = "1.8.2" }
androidx-core = { group = "androidx.core", name = "core-ktx", version = "1.12.0" }
androidx-material = { group = "androidx.compose.material", name = "material", version = "1.5.4" }
androidx-activity = { group = "androidx.activity", name = "activity-compose", version = "1.9.0" }
androidx-core = { group = "androidx.core", name = "core-ktx", version = "1.13.1" }
androidx-material = { group = "androidx.compose.material", name = "material", version = "1.6.7" }
androidx-profileInstaller = { group = "androidx.profileinstaller", name = "profileinstaller", version = "1.3.1" }
androidx-startUp = { group = "androidx.startup", name = "startup-runtime", version = "1.1.1" }
androidx-palette = { group = "androidx.palette", name = "palette-ktx", version = "1.0.0" }
Expand All @@ -162,10 +162,11 @@ paging-common = { group = "app.cash.paging", name = "paging-common", version.ref
paging-compose = { group = "app.cash.paging", name = "paging-compose-common", version.ref = "paging" }
composeUi-windowSize = { group = "dev.chrisbanes.material3", name = "material3-window-size-class-multiplatform", version = "0.3.0" }

leak-canary = { group = "com.squareup.leakcanary", name = "leakcanary-android", version = "2.12" }
leak-canary = { group = "com.squareup.leakcanary", name = "leakcanary-android", version = "2.13" }
junit = { group = "junit", name = "junit", version = "4.13.2" }

ktlint-gradle = { group = "org.jlleitschuh.gradle", name = "ktlint-gradle", version.ref = "ktLint" }
konnection = { group = "dev.tmapps", name = "konnection", version.ref = "konnection" }

zipline = { module = "app.cash.zipline:zipline", version.ref = "zipline" }
zipline-gradlePlugin = { module = "app.cash.zipline:zipline-gradle-plugin", version.ref = "zipline" }
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Sat May 18 15:40:17 IST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ open class ThrowableWrapper(

override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other is ThrowableWrapper && reference != null && other.reference == reference) return true
if (other is Throwable && reference != null && reference == other) return true

if (other !is ThrowableWrapper) return false
if (message != other.message) return false
if (stackTrace != other.stackTrace) return false
Expand Down

0 comments on commit 70bc258

Please sign in to comment.