Skip to content

Commit

Permalink
Adjusting configs
Browse files Browse the repository at this point in the history
  • Loading branch information
carlospontual committed Mar 19, 2024
1 parent 1170fd0 commit 31fbeaf
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 26 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
- 'master'

env:
NEXUS_URL: ${{ secrets.NEXUS_URL }}
NEXUS_USERID: ${{ secrets.NEXUS_USERID }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
REPO_ARTIFACTS_URL: ${{ secrets.REPO_ARTIFACTS_URL }}
REPO_USERID: ${{ secrets.REPO_USERID }}
REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}

jobs:
build:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ on:
branches:
- 'datastore-kotlin-impl'
env:
NEXUS_URL: ${{ secrets.NEXUS_URL }}
NEXUS_USERID: ${{ secrets.NEXUS_USERID }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
REPO_ARTIFACTS_URL: ${{ secrets.REPO_ARTIFACTS_URL }}
REPO_PUBLISH_URL: ${{ secrets.REPO_PUBLISH_URL }}
REPO_USERID: ${{ secrets.REPO_USERID }}
REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}

jobs:
build:
Expand All @@ -23,4 +24,4 @@ jobs:
run: ./gradlew persistent-cookie-jar-okhttp:test

- name: Publish Library
run: ./gradlew --stacktrace -PnexusURL=$NEXUS_URL -PnexusUserName=$NEXUS_USERID -PnexusUserPassword=$NEXUS_PASSWORD clean persistent-cookie-jar-okhttp:assembleRelease publish
run: ./gradlew --stacktrace -PrepoPublishURL=$REPO_PUBLISH_URL -PrepoUserName=$REPO_USERID -PrepoUserPassword=$REPO_PASSWORD clean persistent-cookie-jar-okhttp:assembleRelease publish
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.useAndroidX=true
android.useAndroidX=true
13 changes: 7 additions & 6 deletions persistent-cookie-jar-okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@ dependencies {
afterEvaluate {
publishing {
// These values are provided by the CI environment, args are retrieved from the command line.
val nexusURL: String? by project
val nexusUserName: String? by project
val nexusUserPassword: String? by project
val repoPublishURL: String? by project
val repoUserName: String? by project
val repoUserPassword: String? by project

repositories {
maven {
url = uri(nexusURL ?: "")
url = uri(repoPublishURL ?: "")
credentials {
username = nexusUserName
password = nexusUserPassword
username = repoUserName
password = repoUserPassword
}
}
}
Expand Down
26 changes: 14 additions & 12 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ pluginManagement {
//do Nothing
}
}.also {
val nexusURL: String = System.getenv("NEXUS_URL") ?: it.getProperty("NEXUS_URL")
val nexusUsername: String = System.getenv("NEXUS_USERID") ?: it.getProperty("NEXUS_USERID")
val nexusPassword: String = System.getenv("NEXUS_PASSWORD") ?: it.getProperty("NEXUS_PASSWORD")
print(it)

extra.set("nexusURL", nexusURL)
extra.set("nexusUsername", nexusUsername)
extra.set("nexusPassword", nexusPassword)
val repoArtifactsURL: String = System.getenv("REPO_ARTIFACTS_URL") ?: it.getProperty("REPO_ARTIFACTS_URL")
val repoUsername: String = System.getenv("REPO_USERID") ?: it.getProperty("REPO_USERID")
val repoPassword: String = System.getenv("REPO_PASSWORD") ?: it.getProperty("REPO_PASSWORD")

extra.set("repoArtifactsURL", repoArtifactsURL)
extra.set("repoUsername", repoUsername)
extra.set("repoPassword", repoPassword)
}

repositories {
maven {
url = uri(extra.get("nexusURL") as String)
url = uri(extra.get("repoArtifactsURL") as String)
credentials {
username = extra.get("nexusUsername") as String
password = extra.get("nexusPassword") as String
username = extra.get("repoUsername") as String
password = extra.get("repoPassword") as String
}
}
}
Expand All @@ -30,10 +32,10 @@ dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven {
url = uri(extra.get("nexusURL") as String)
url = uri(extra.get("repoArtifactsURL") as String)
credentials {
username = extra.get("nexusUsername") as String
password = extra.get("nexusPassword") as String
username = extra.get("repoUsername") as String
password = extra.get("repoPassword") as String
}
}
}
Expand Down

0 comments on commit 31fbeaf

Please sign in to comment.