Skip to content

Instantly share code, notes, and snippets.

@knshiro
Created August 5, 2015 08:35
Show Gist options
  • Save knshiro/efeb300e7cc7b1968fe2 to your computer and use it in GitHub Desktop.
Save knshiro/efeb300e7cc7b1968fe2 to your computer and use it in GitHub Desktop.
Publish a deb with sbt and sbt-native-packager to bintray
import _root_.bintray.Bintray
enablePlugins(JavaAppPackaging, JDebPackaging)
name := "my-project"
maintainer := "My name <my.name@mail.io>"
packageSummary := "Super package"
packageDescription := """Package doing wonderful things"""
val publishToDeb = taskKey[Unit]("Publish to debian repository")
publishToDeb := {
val credsFile = bintrayCredentialsFile.value
val btyOrg = bintrayOrganization.value
val repoName = "debian"
val pkgName = bintrayPackage.value
val vers = version.value
val f = (packageBin in Debian).value
val path = "pool/main/w/" + name.value + "/" + f.getName + ";deb_distribution=wheezy;deb_component=main;deb_architecture=i386,amd64"
val log = streams.value.log
// ensure that we have credentials to build a resolver that can publish to bintray
Bintray.withRepo(credsFile, btyOrg, repoName, prompt = false) { repo =>
repo.upload(pkgName, vers, path, f, log)
repo.release(pkgName, vers, log)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment