Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing to Jitpack and MavenCentral #884

Closed
kibotu opened this issue Dec 17, 2024 · 3 comments
Closed

Publishing to Jitpack and MavenCentral #884

kibotu opened this issue Dec 17, 2024 · 3 comments

Comments

@kibotu
Copy link

kibotu commented Dec 17, 2024

Sorry to abuse issues to ask a question, but is there a way to disable signing for jitpack?

currently I have to add a check, but it feels not like the intended way to do it. any suggestions? e.g. https://github.com/kibotu/AndroidResourceExtensions/blob/master/AndroidResourceExtensions/build.gradle#L77-L99

if (!System.getenv("JITPACK") == "true") {
    apply plugin: 'com.vanniktech.maven.publish'
    mavenPublishing {
        publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL, true)
        signAllPublications()
    }
}

if (System.getenv("JITPACK") == "true") {
    apply plugin: 'maven-publish'
    afterEvaluate {
        publishing {
            publications {
                release(MavenPublication) {
                    from components.release
                    groupId = GROUP
                    artifactId = POM_ARTIFACT_ID
                    version = version
                }
            }
        }
    }
}
@gabrielittner
Copy link
Collaborator

Is it specifically signing that fails on jitpack?

@kibotu
Copy link
Author

kibotu commented Dec 19, 2024

Yes, mainly because I don't have a way to provide credentials to jitpack

@gabrielittner
Copy link
Collaborator

I can see simple solutions:

  1. You do what you're doing already but just limit the if check for the signAllPublications. That way you can still let this plugin configure the rest of the publishing for jitpack and don't to manually apply maven-publish
  2. Instead of using signAllPublications() you use the RELEASE_SIGNING_ENABLED Gradle property. That would allow to have signing off by default and then you can explicitly set it when publishing to maven central, for example by adding -PRELEASE_SIGNING_ENABLED=true to the Gradle publish command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants