SBT GitHub tasks
- Upload SBT artifacts to GitHub
Add the following to project/plugins/Plugins.scala:
import sbt._
class Plugins(info: ProjectInfo) extends PluginDefinition(info)
{
val sbtGitHubPlugin = "com.github.oxlade39" % "sbt-github-plugin" % "2.0.1"
}
com.github.oxlade39.githubuploader.GitHubUploadedArtifacts
import sbt._
import com.github.oxlade39.githubuploader.GitHubUploadedArtifacts
class MyProject(info: ProjectInfo) extends DefaultProject(info) with GitHubUploadedArtifacts {
...
}
reload and update in SBT, then you can use the task git-hub-upload
By default git-hub-upload will upload all of your SBT defined artifacts to your remote GitHub download page.
sbt-github-plugin eats its own dog food and uses the GitHubUploadedArtifacts trait to upload artifacts to the downloads page. You can see the definition here
git-hub-upload assumes some default behaviour which is standard GitHub practice. It uses JGit to work out your GitHub remote repository, username and GitHub token. All required to upload to GitHub.
The default assumptions are:
- Your project is set up already tracking your remote GitHub repository
- You have set up git with your GitHub token as described here
- Your GitHub repository is being tracked as origin
All of these assumptions are configurable:
import sbt._
import com.github.oxlade39.githubuploader.GitHubUploadedArtifacts
import com.github.oxlade39.githubuploader.SbtGitHubPluginConfig
class SBTGitHubPluginProject(info: ProjectInfo) extends DefaultProject(info) with GitHubUploadedArtifacts {
override def customConfiguration: Option[SbtGitHubPluginConfig] =
Some(SbtGitHubPluginConfig("github", "remote", "remoteRefName"))
}