Skip to content

Commit

Permalink
[no ci] fix publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Nov 21, 2023
1 parent 7b5cab7 commit a46fa3f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
./gradlew build
- name: Publish
run: |
./gradlew publish publishPlugins closeAndReleaseSonatypeStagingRepository
./gradlew release closeAndReleaseSonatypeStagingRepository
env:
IS_RELEASE: true
MAVEN_USER: github
Expand Down
6 changes: 5 additions & 1 deletion buildSrc/src/main/groovy/opensesame.conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,8 @@ class OpenSesameConventionExtension {
}
}

project.extensions.add('openSesameConvention', OpenSesameConventionExtension)
project.extensions.add('openSesameConvention', OpenSesameConventionExtension)

tasks.register('release') {
dependsOn('publish')
}
47 changes: 21 additions & 26 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,30 @@ processResources {
from rootProject.file('LICENSE')
}

if (System.getenv('GRADLE_PLUGIN_KEY')) {
ext['gradle.publish.key'] = System.getenv('GRADLE_PLUGIN_KEY')
ext['gradle.publish.secret'] = System.getenv('GRADLE_PLUGIN_SECRET')
}

afterEvaluate {
publishing.repositories.clear()

if (System.getenv('PR_NUMBER')) {
publishing {
repositories {
maven {
name = 'LocalMaven'
url = rootProject.layout.buildDirectory.dir('repo')
}
if (System.getenv('PR_NUMBER')) {
publishing {
repositories {
maven {
name = 'LocalMaven'
url = rootProject.layout.buildDirectory.dir('repo')
}
}
} else if (System.getenv('SNAPSHOT_MAVEN_URL')) {
publishing {
repositories {
maven {
name = 'PersonalMaven'
url = uri(System.getenv('SNAPSHOT_MAVEN_URL'))
credentials {
username = System.getenv('MAVEN_USER')
password = System.getenv('MAVEN_PASSWORD')
}
}
} else if (System.getenv('SNAPSHOT_MAVEN_URL')) {
publishing {
repositories {
maven {
name = 'PersonalMaven'
url = uri(System.getenv('SNAPSHOT_MAVEN_URL'))
credentials {
username = System.getenv('MAVEN_USER')
password = System.getenv('MAVEN_PASSWORD')
}
}
}
}
}
}

tasks.register('release') {
dependsOn('publishPlugins')
}

0 comments on commit a46fa3f

Please sign in to comment.