Skip to content

Commit e6d9caa

Browse files
author
JeanMarc van Leerdam
committed
Describe the expected release process; include plugins that are needed for the release process
1 parent dcafa45 commit e6d9caa

File tree

5 files changed

+88
-14
lines changed

5 files changed

+88
-14
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
target/
66
local_env.sh
77
*.iml
8+
9+
.env

.jvmopts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--add-opens=java.base/java.util=ALL-UNNAMED
2+
--add-opens=java.base/java.lang=ALL-UNNAMED

README.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,32 @@ Note: to successfully run the `deploy` scripted test, you need to have the Azure
9696
to a subscription that has a resource group and storage account as specified in the `sbt-test/sbt-azure-functions/deploy/build.sbt` file.
9797

9898
## Releasing (for plugin maintainers)
99-
To release a new version:
100-
* Get a [bintray](https://bintray.com) account and make sure you're a member of the [`code-star`](https://bintray.com/code-star) organization.
101-
* Set your credentials - you can use `sbt bintrayChangeCredentials`, but when run from the interactive sbt prompt
102-
you will not see the requests for username and password. So blindly first type your username, press enter, then
103-
paste your API key and press enter again.
104-
105-
(found a workaround that shows the prompt again: add to build.sbt: `ThisBuild / useSuperShell := false`)
106-
* reload to make new settings known to sbt
107-
* Run `sbt release`
108-
109-
Update Feb 2021: we started moving away from Bintray. We will start using sbt-ci-release and release to Maven Central.
99+
To release a new version, make sure you have:
100+
* proper access to the `nl.codestar` namespace on Sonatype.
101+
* GnuPG (`gpg`) installed and a signing key configured.
102+
* We use `sbt-pgp` plugin to sign, which relies on the `gpg` command line tool
103+
* create a `.env` file in the project root with the following variables:
104+
```
105+
PGP_KEYID=<id of the signing key>
106+
PGP_PASSPHRASE=<your PGP passphrase>
107+
SONATYPE_USER=<user id or token id>
108+
SONATYPE_PASSWORD=<password or token>
109+
110+
```
111+
112+
Note: The `.env` file needs to be kept out of the git repository (it is `.gitignore`d).
113+
114+
See [Using Sonatype](https://www.scala-sbt.org/1.x/docs/Using-Sonatype.html) in the SBT documentation.
115+
116+
Steps to release SNAPSHOT version (not preferred):
117+
1. `sbt publishSigned`
118+
2. `sbt sonaUpload`
119+
3. Go to https://central.sonatype.com/publishing/deployments and publish the deployment.
120+
* or run `sbt sonaRelease` to publish the deployment automatically
121+
122+
Steps to release (preferred):
123+
1. Tag the current commit with the new version number, e.g. `git tag v0.5.0`
124+
2. `sbt publishSigned`
125+
3. `sbt sonaUpload`
126+
4. Go to https://central.sonatype.com/publishing/deployments and publish the deployment.
127+
* or run `sbt sonaRelease` to publish the deployment automatically

build.sbt

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
lazy val commonSettings = Seq(
22
organization := "nl.codestar",
33
homepage := Some(url("https://github.com/code-star/sbt-azure-functions-plugin")),
4-
// version is set by sbt-dynver plugin (included through sbt-ci-assembly)
4+
// version is set by sbt-dynver plugin (included through sbt-ci-release)
55
description := "SBT Plugin to generate function.json artefacts needed to publish code as an Azure Function",
6+
organization := "nl.codestar",
7+
organizationName := "Codestar powered by Sopra Steria",
8+
organizationHomepage := Some(url("https://codestar.nl")),
9+
homepage := Some(url("https://codestar.nl/sbt-azure-functions-plugin")),
610
licenses += ("MIT", url("https://opensource.org/licenses/MIT")),
711
developers := List(
812
Developer(
@@ -11,7 +15,38 @@ lazy val commonSettings = Seq(
1115
"jean-marc.vanleerdam@soprasteria.com",
1216
url("https://soprasteria.com")
1317
)
18+
),
19+
scmInfo := Some(
20+
ScmInfo(
21+
url("https://github.com/code-star/sbt-azure-functions-plugin"),"scm:git@github.com:code-star/sbt-azure-functions-plugin.git")
22+
),
23+
credentials ++= Seq(
24+
Credentials(
25+
"GnuPG Key ID",
26+
"gpg",
27+
System.getenv("PGP_KEYID"), // key identifier
28+
"ignored" // this field is ignored; passwords are supplied by pinentry
29+
),
30+
Credentials(
31+
"Sonatype Nexus Repository Manager",
32+
"oss.sonatype.org",
33+
System.getenv("SONATYPE_USER"),
34+
System.getenv("SONATYPE_PASSWORD") // Use environment variable for security
35+
),
36+
Credentials(
37+
"Sonatype Nexus Repository Manager",
38+
"central.sonatype.com",
39+
System.getenv("SONATYPE_USER"),
40+
System.getenv("SONATYPE_PASSWORD") // Use environment variable for security
41+
),
42+
Credentials(
43+
"central-snapshots",
44+
"central.sonatype.com",
45+
System.getenv("SONATYPE_USER"),
46+
System.getenv("SONATYPE_PASSWORD") // Use environment variable for security
47+
)
1448
)
49+
1550
)
1651

1752
lazy val root = project.in(file("."))
@@ -29,6 +64,12 @@ lazy val plugin = project.in(file("plugin"))
2964
.settings(
3065
name := "sbt-azure-functions",
3166
commonSettings,
67+
scalaVersion := "2.12.18",
68+
pluginCrossBuild / sbtVersion := {
69+
scalaBinaryVersion.value match {
70+
case "2.12" => "1.11.4" // set minimum version
71+
}
72+
},
3273
scalacOptions ++= Seq(
3374
"-encoding",
3475
"UTF8",
@@ -60,3 +101,12 @@ lazy val plugin = project.in(file("plugin"))
60101

61102
// workaround for interactive sessions that do not echo the user input (https://github.com/sbt/sbt-bintray/issues/177)
62103
ThisBuild / useSuperShell := false
104+
105+
ThisBuild / pomIncludeRepository := { _ => false }
106+
ThisBuild / publishMavenStyle := true
107+
108+
ThisBuild / publishTo := {
109+
val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
110+
if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
111+
else localStaging.value
112+
}

project/plugins.sbt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.1")
2-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1")
31
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "2.0.13")
2+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1")
3+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.1")
4+
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
5+
addSbtPlugin("nl.gn0s1s" % "sbt-dotenv" % "3.1.1")

0 commit comments

Comments
 (0)