devops automator for scala/sbt projects
This is a sbt AutoPlugin that do 4 things:
- Setup scalafmt
- Setup Github Action CI to
- QA (Quality Assurance) check by running
sbt test devopsQA
- Auto release when you push code to github
- Release to maven central (sonatype oss) if your project is open source
- Release to your private nexus repository if your project is private
- Release to
releasesmaven if you push a git tag with special prefix
- Release to
- notify to mattermost when the CI jobs completed
- Setup other things such as adding a badge to README.md,..
devopsQA task validate that
- You have setup CI, scalafmt
- Your code is formatted
- You don't define version manually
- You don't break binary compatibility with the previous stable version
- ... see source code for more detail
- Notify your Mattermost or Slack webhook when CI jobs done
- The message also contains jobs info such as status, published version, link to job, optional mentions like @channel, @here, @some_user
4. Auto add some sbt settings such as
version: Auto get from git
resolvers += your private repository(unless using
publishMavenStyle := true
credentials,.. See source code for more detail.
- Of course, you can override those settings in your project
- For private projects that will be published to repo.bennuoc.com
addSbtPlugin("com.sandinh" % "sbt-devops" % "<version>")
- For oss projects that will be publish to sonatype oss
addSbtPlugin("com.sandinh" % "sbt-devops-oss" % "<version>")
See releases for available
Release with tag
vM.N.P => version
v3.0.0 => version
- install (see above) -> run
- (optional) remove some sbt settings that have been defined by sbt-devops such as
publishTo,.. see above.
- If you use private maven hosting with
sbt-devopsthen add this to
Global / devopsNexusHost := "<your repo, ex repo.example.com>"
- To auto release, you need manually setup secrets in your github repo setting:
Your github repo -> Settings -> Secrets -> New repository secret
- sbt-devops (private maven repository)
NEXUS_PASS: Your username/ password in
SONATYPE_USERNAME, SONATYPE_PASSWORD: Your username/ password in sonatype oss
PGP_SECRET, PGP_PASSPHRASE: See sbt-ci-release's guide
- secrets need to notify mattermost/ slack:
MATTERMOST_WEBHOOK_URLSee files/sbt-devops.yml for details and how to customize message, icon, channel,..
- (optional) customize
- Commit changes, push -> auto publish -> notify.
- Tag to release: Push tag -> publish release version.
The tag format must be
v1.2.3-blablato release version
- Push commit has no matched tag -> publish
This project use:
- Depends on sbt plugins: sbt-scalafmt, sbt-dynver, sbt-git, sbt-sonatype, sbt-pgp
- Copy some code from sbt-ci-release plugins.
- sbt-version-policy and MiMa
- Use lihaoyi's ujson
- of course scala, sbt and the transitive dependencies. Thanks you all!
This software is licensed under the Apache 2 license
Copyright 2021 Sân Đình (https://sandinh.com)
For Sân Đình's projects only (private or oss)
sd-devops-oss instead of
It add some predefined settings for sandinh such as:
organization := "com.sandinh"
- ... see sbtsd code for more details.