Skip to content

Commit

Permalink
Enabled releases to Maven Central
Browse files Browse the repository at this point in the history
Fixed the bug with how we controlled Maven Central releases via commit messages.

Testing done: Ran the workflow in a forked repository and b) observed that the information from the commit message is passed to the environment variable.
  • Loading branch information
mockitoguy committed Nov 25, 2020
1 parent f8d0f1b commit 3213b49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,6 @@ jobs:
- name: Build and publish
run: ./gradlew bintrayUpload githubRelease --scan
env:
MAVEN_CENTRAL_RELEASE: ${{contains(toJSON(github.event.commits.*.message), '[ci maven-central-release]')}}
GH_WRITE_TOKEN: ${{secrets.GH_WRITE_TOKEN}}
BINTRAY_API_KEY: ${{secrets.BINTRAY_API_KEY}}
2 changes: 1 addition & 1 deletion gradle/shipkit.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ext.mavenCentralRelease = shouldReleaseToCentral(project)
* To test this logic, run build with '-i' (info logging) and inspect the build output.
*/
static boolean shouldReleaseToCentral(project) {
boolean centralReleaseByCommit = System.getenv("TRAVIS_COMMIT_MESSAGE")?.contains("[ci maven-central-release]")
boolean centralReleaseByCommit = 'true' == System.getenv("MAVEN_CENTRAL_RELEASE")
boolean centralReleaseByProjectProperty = project.hasProperty("maven-central-release")
boolean centralRelease = centralReleaseByCommit || centralReleaseByProjectProperty
def message = """Bintray publish was using following settings:
Expand Down

0 comments on commit 3213b49

Please sign in to comment.