Skip to content

Instantly share code, notes, and snippets.

@fritzprix
Last active July 7, 2021 21:39
Show Gist options
  • Save fritzprix/17ff8458a56c40c734fc77109e36cf19 to your computer and use it in GitHub Desktop.
Save fritzprix/17ff8458a56c40c734fc77109e36cf19 to your computer and use it in GitHub Desktop.
deploy.github.gradle
import java.nio.charset.StandardCharsets
apply plugin: 'maven'
repositories {
maven { url "https://raw.github.com/fritzprix/wagon-git/releases" }
}
configurations {
deployLibrary
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
deployLibrary "ar.com.synergian:wagon-git:0.3.1"
}
task sourceJar(type: Jar) {
classifier "sources"
from sourceSets.main.allJava
}
artifacts {
archives sourceJar
}
uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployLibrary
repository(url: "git:${ARTIFACT_VERSION.toUpperCase().contains("SNAPSHOT")? "snapshot" : "release"}://https://${USERNAME}:${PASSWORD}@github.com/${PROJECT.toLowerCase()}/${REPOSITORY_NAME}.git")
pom.project {
groupId = ARTIFACT_PACKAGE
version = ARTIFACT_VERSION
artifactId = ARTIFACT_NAME
packaging ARTIFACT_PACKAGING
}
}
mavenDeployer {
configuration = configurations.deployLibrary
repository{
mavenLocal()
}
pom.project {
groupId = ARTIFACT_PACKAGE
version = ARTIFACT_VERSION
artifactId = ARTIFACT_NAME
packaging ARTIFACT_PACKAGING
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment