Skip to content

Commit

Permalink
[PM-2653] Add version file to automation
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradStaniec committed Jan 13, 2021
1 parent f414a63 commit 6997948
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .circleci/publish
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ mill mill.scalalib.PublishModule/publishAll \
--gpgArgs --passphrase="$GPG_PASSPHRASE",--batch,--yes,-a,-b

elif [[ "$CIRCLE_BRANCH" == "master" ]]; then


mill versionFile.setReleaseVersion
mill mill.scalalib.PublishModule/publishAll \
__.publishArtifacts \
"$OSS_USERNAME":"$OSS_PASSWORD" \
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ To use it in a downstream project add the snapshots to the resolvers, e.g. in `b
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
```

To publish new release to maven central:
1. Create release branch `realease/versionFromVersionFile`
2. Crete pr from release branch to `master` branch
3. Merge release pr to `master`, tag merge commit and push it
4. Create merge back pr from `master` to `develop` bumping appropriate version in `versionFile/version`


### Formatting the codebase
In order to keep the code format consistent, we use scalafmt.

Expand Down
5 changes: 4 additions & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import ammonite.ops._
import coursier.maven.MavenRepository
import mill.scalalib.{PublishModule, ScalaModule}
import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl}
import $ivy.`com.lihaoyi::mill-contrib-versionfile:$MILL_VERSION`
import mill.contrib.versionfile.VersionFileModule

object versionFile extends VersionFileModule
object csm extends Cross[ScalanetModule]("2.12.10", "2.13.4")

class ScalanetModule(crossVersion: String) extends Module {
Expand Down Expand Up @@ -101,7 +104,7 @@ class ScalanetModule(crossVersion: String) extends Module {
trait ScalanetPublishModule extends PublishModule {
def description: String

override def publishVersion = "0.6.0-SNAPSHOT"
override def publishVersion = versionFile.currentVersion().toString

override def pomSettings = PomSettings(
description = description,
Expand Down
1 change: 1 addition & 0 deletions versionFile/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.6.0-SNAPSHOT

0 comments on commit 6997948

Please sign in to comment.