Skip to content

Commit eae1725

Browse files
committed
Update Release instructions
1 parent bb0f14e commit eae1725

File tree

3 files changed

+25
-52
lines changed

3 files changed

+25
-52
lines changed

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,21 @@ which can be used for sending requests to the server instance.
66

77
## Release
88

9-
Every new commit in master is built and released as a
10-
`-SNAPSHOT`. Once you tested that everything works, do the following
11-
to create an actual release.
9+
[Tag](https://github.com/moia-oss/itkit/tags) the new version (e.g. `v3.0.0`) and push the tags (`git push origin --tags`).
1210

13-
1. Create an empty commit using `git commit --allow-empty` and specify
14-
which version you are releasing.
11+
You need a [public GPG key](https://www.scala-sbt.org/release/docs/Using-Sonatype.html) with your MOIA email and an account on https://oss.sonatype.org that can [access](https://issues.sonatype.org/browse/OSSRH-52948) the `io.moia` group.
1512

16-
2. Tag (annotated tag with description) the new commit with a `v`
17-
prefix, e.g. `v1.0.0`. The `sbt-git` plugin automatically sets the
18-
`version` to the tag without the `v` (`1.0.0` in our example).
13+
Add your credentials to `~/.sbt/sonatype_credential` and run
14+
```sbt
15+
sbt:itkit> +publishSigned
16+
```
1917

20-
3. Push the commit **AND** the tag. For example using `git push --tags` and then `git push origin master` from the CLI.
18+
Then close and release the [repository](https://oss.sonatype.org/#stagingRepositories).
19+
```
20+
sbt:itkit> +sonatypeRelease
21+
```
2122

22-
Once the master pipeline runs, the version will be automatically published.
23+
Afterwards, add the release to [GitHub](https://github.com/moia-oss/itkit/releases).
2324

2425
## Usage
2526

build.sbt

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ lazy val itkit =
1313
.configs(IntegrationTest)
1414
.settings(Defaults.itSettings: _*)
1515
.settings(commonSettings)
16-
.settings(packageSettings)
17-
.settings(publishSettings)
1816
.settings(
1917
libraryDependencies ++= Seq(
2018
// compile time dependencies
@@ -90,8 +88,6 @@ lazy val commonSettings =
9088
scapegoatSettings ++
9189
sbtGitSettings
9290

93-
lazy val packageSettings = releaseSettings
94-
9591
lazy val compilerSettings =
9692
Seq(
9793
scalaVersion := "2.13.5",
@@ -136,35 +132,16 @@ lazy val licenseSettings =
136132

137133
lazy val organizationSettings = Seq(organization := "io.moia")
138134

139-
import ReleaseTransformations._
140-
141-
lazy val releaseSettings =
142-
Seq(
143-
releaseProcess := Seq(
144-
checkSnapshotDependencies,
145-
inquireVersions,
146-
runClean,
147-
runTest,
148-
releaseStepCommand("scapegoat"),
149-
setReleaseVersion,
150-
commitReleaseVersion,
151-
tagRelease,
152-
setNextVersion,
153-
commitNextVersion,
154-
pushChanges
155-
)
156-
)
157-
158-
lazy val publishSettings =
135+
lazy val sonatypeSettings = {
136+
import xerial.sbt.Sonatype._
159137
Seq(
160-
// enable artifactory as resolver as well as publishing sink
161-
credentials ++= Seq(Path.userHome / ".ivy2" / ".credentials").filter(_.exists).map(Credentials(_)),
162-
credentials += (for {
163-
user <- sys.env.get("ARTIFACTORY_USER")
164-
pass <- sys.env.get("ARTIFACTORY_PASS")
165-
} yield Credentials("Artifactory Realm", "moiadev.jfrog.io", user, pass)),
166-
publishTo := Some("Artifactory Realm" at "https://moiadev.jfrog.io/artifactory/sbt-release-local/")
138+
publishTo := sonatypePublishTo.value,
139+
sonatypeProfileName := organization.value,
140+
publishMavenStyle := true,
141+
sonatypeProjectHosting := Some(GitHubHosting("moia-oss", "itkit", "[email protected]")),
142+
credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credential")
167143
)
144+
}
168145

169146
lazy val sbtSettings = Seq(cancelable in Global := true)
170147

project/plugins.sbt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,17 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.1")
99
// Automatically adds license information to each source code file.
1010
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
1111

12-
// Release a new version of the app
13-
// The following command builds a Docker image, publishes it to ECR and bumps the version in version.sbt
14-
// sbt> release
15-
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.0.15")
16-
1712
// Formatting in scala
1813
// See .scalafmt.conf for configuration details.
1914
// Formatting takes place before the project is compiled.
2015
addSbtPlugin( "org.scalameta" % "sbt-scalafmt" % "2.0.7")
2116

22-
// Code coverage report. The code has to be instrumented, therefore a clean build is needed.
23-
// sbt> clean
24-
// sbt> coverage test
25-
// sbt> coverageReport
26-
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.8.2")
27-
2817
// Static code analysis.
2918
// sbt> scapegoat
3019
addSbtPlugin("com.sksamuel.scapegoat" % "sbt-scapegoat" % "1.1.0")
20+
21+
// Publish to sonatype
22+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7")
23+
24+
// publishSigned
25+
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")

0 commit comments

Comments
 (0)