Skip to content

Commit

Permalink
Setting version to 0.1.18
Browse files Browse the repository at this point in the history
Minor changes and formatting in build file
Migrated from Legacy OSSRH to Central publishing, token is used to publish
  • Loading branch information
gmkumar2005 committed Jan 20, 2025
1 parent 65b6a11 commit cce75b0
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 10 deletions.
46 changes: 46 additions & 0 deletions SimpleCommands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
### Release process

#### Verify gpg is working

```sh
echo "test" | gpg --clearsign -u F7E440260BAE93EB4AD2723D6613CA76E011F638
```

```text
export SONATYPE_USERNAME=<<username>>
export SONATYPE_PASSWORD=<<password>>
```

#### And in your credentials file (~/.sbt/1.0/sonatype.sbt):

```
credentials += Credentials(
"Sonatype Nexus Repository Manager",
"s01.oss.sonatype.org", // Note the s01 subdomain
"your-username",
"your-password"
)
```

#### Copy sonatype.sbt to sonatype.credentials

```
cp sonatype.sbt sonatype.credentials
```
### Run sbt commands
```sh
sbt release
*** Current release and next release has to be same.

sbt sonatypeBundleRelease

```

### Verify
```
Login to central.sonatype.com
Check https://central.sonatype.com/publishing/deployments
Wait for 24 hrs for publishing to complete
```
29 changes: 20 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations.*
import sbtrelease.ReleaseStateTransformations.{checkSnapshotDependencies, inquireVersions, runClean}
import xerial.sbt.Sonatype.*

ThisBuild / sonatypeCredentialHost := sonatypeCentralHost
organization := "io.github.gmkumar2005"
organizationName := "io.github.gmkumar2005"
scalaVersion := "2.12.20"
Expand Down Expand Up @@ -53,19 +56,27 @@ lazy val root = (project in file(".")).settings(
setReleaseVersion,
commitReleaseVersion,
tagRelease,
ReleaseStep(action = Command.process("publishSigned", _)),
ReleaseStep(action = st => Command.process("publishSigned", st, _ => ())),
setNextVersion,
commitNextVersion
),
publishTo := {
val nexus = "https://s01.oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
publishMavenStyle := true,
publishTo := sonatypePublishToBundle.value,
// publishTo := {
// val nexus = "https://s01.oss.sonatype.org/"
// if (isSnapshot.value)
// Some("snapshots" at nexus + "content/repositories/snapshots")
// else
// Some("releases" at nexus + "service/local/staging/deploy/maven2")
// },
// credentials += Credentials(
// "Sonatype Nexus Repository Manager",
// "s01.oss.sonatype.org",
// sys.env("SONATYPE_USERNAME"),
// sys.env("SONATYPE_PASSWORD")),

// For all Sonatype accounts created on or after February 2021
sonatypeCredentialHost := "s01.oss.sonatype.org",
// sonatypeCredentialHost := "s01.oss.sonatype.org",
Test / parallelExecution := true,
Test / publishArtifact := false,
usePgpKeyHex("F7E440260BAE93EB4AD2723D6613CA76E011F638")
Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ThisBuild / version := "0.1.12-SNAPSHOT"
ThisBuild / version := "0.1.18-SNAPSHOT"

0 comments on commit cce75b0

Please sign in to comment.