Skip to content

Commit

Permalink
Updated build and publish process to allow for embedding into other p…
Browse files Browse the repository at this point in the history
…rojects
  • Loading branch information
Radu-Voinea committed Sep 8, 2024
1 parent 711a662 commit 87ca780
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ jobs:
run: |
mkdir -p ~/.gradle
echo "
voinearadu.url=https://repository.voinearadu.com/repository/maven-releases/
voinearadu.auth.username=admin
voinearadu.auth.password=${{ secrets.NEXUS_PASSWORD }}
com.voinearadu.url=https://repository.voinearadu.com/repository/maven-releases/
com.voinearadu.auth.username=admin
com.voinearadu.auth.password=${{ secrets.NEXUS_PASSWORD }}
" > ~/.gradle/gradle.properties
if [ "${{ secrets.NEXUS_PASSWORD }}" == "" ]; then echo "com.voinearadu.publish=false" >> ~/.gradle/gradle.properties; fi
- name: Cache Gradle Dependencies
uses: actions/cache@v4
Expand Down
20 changes: 11 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ plugins {
id("maven-publish")
}

val _group = libs.versions.group.get()
val _version = libs.versions.version.get()

group = _group
version = _version
group = libs.versions.group.get()
version = libs.versions.version.get()

repositories {
println(project.properties["com.voinearadu.publish"])

mavenCentral()
maven("https://repository.voinearadu.dev/repository/maven-releases/")
}
Expand Down Expand Up @@ -67,10 +66,13 @@ publishing {
}

repositories {
maven(url = (project.findProperty("voinearadu.url") ?: "") as String) {
credentials(PasswordCredentials::class) {
username = (project.findProperty("voinearadu.auth.username") ?: "") as String
password = (project.findProperty("voinearadu.auth.password") ?: "") as String
if (project.properties["com.voinearadu.publish"] == "true") {
maven(url = (project.findProperty("com.voinearadu.url") ?: "") as String) {
name = "VoineaRaduRepository"
credentials(PasswordCredentials::class) {
username = (project.findProperty("com.voinearadu.auth.username") ?: "") as String
password = (project.findProperty("com.voinearadu.auth.password") ?: "") as String
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.voinearadu.publish=false

0 comments on commit 87ca780

Please sign in to comment.