Skip to content

Commit 10f871b

Browse files
committed
build: add publish flow
Signed-off-by: unlsycn <unlsycn@unlsycn.com>
1 parent fac412c commit 10f871b

6 files changed

Lines changed: 37 additions & 11 deletions

File tree

build.mill

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
// SPDX-FileCopyrightText: 2025 Jiuyang Liu <liu@jiuyang.me>
33
package build
44

5+
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.1`
6+
57
import mill._
68
import mill.scalalib.TestModule.Utest
79
import mill.scalalib._
10+
import mill.scalalib.publish._
811
import mill.scalalib.scalafmt._
12+
import de.tobiasroeser.mill.vcs.version.VcsVersion
913
import $ivy.`com.lihaoyi::mill-contrib-jmh:`
1014
import contrib.jmh.JmhModule
1115
import os.Path
@@ -23,6 +27,29 @@ object v {
2327
val jmh = "1.35"
2428
}
2529

30+
trait ZaoziPublishModule extends PublishModule {
31+
def publishVersion: mill.T[String] = VcsVersion
32+
.vcsState()
33+
.format(
34+
countSep = "+",
35+
revHashDigits = 8,
36+
untaggedSuffix = "-SNAPSHOT"
37+
)
38+
39+
def pomSettings = T(
40+
PomSettings(
41+
description = artifactName(),
42+
organization = "me.jiuyang",
43+
url = "https://github.com/sequencer/zaozi",
44+
licenses = Seq(License.`Apache-2.0`),
45+
versionControl = VersionControl.github("sequencer", "zaozi"),
46+
developers = Seq(
47+
Developer("sequencer", "Jiuyang Liu", "https://github.com/sequencer")
48+
)
49+
)
50+
)
51+
}
52+
2653
// Panama API
2754
trait PanamaModule extends JavaModule {
2855
val license = Seq(

circtlib/package.mill

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import mill.scalalib._
77
import mill.scalalib.TestModule.Utest
88
import mill.scalalib.scalafmt._
99

10-
import build.{mlirlib, v, PanamaModule}
10+
import build.{mlirlib, v, PanamaModule, ZaoziPublishModule}
1111

12-
object `package` extends RootModule with ScalaModule with ScalafmtModule with PanamaModule { outer =>
12+
object `package` extends RootModule with ScalaModule with ScalafmtModule with PanamaModule with ZaoziPublishModule {
13+
outer =>
1314
def scalaVersion = Task(v.scala)
1415

1516
override def dumpIncludes() = Task.Command {

mlirlib/package.mill

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import mill.scalalib._
77
import mill.scalalib.TestModule.Utest
88
import mill.scalalib.scalafmt._
99

10-
import build.{v, PanamaModule}
10+
import build.{v, PanamaModule, ZaoziPublishModule}
1111

12-
object `package` extends RootModule with ScalaModule with ScalafmtModule with PanamaModule {
12+
object `package` extends RootModule with ScalaModule with ScalafmtModule with PanamaModule with ZaoziPublishModule {
1313
def scalaVersion = Task(v.scala)
1414

1515
override def dumpIncludes() = Task.Command {

omlib/package.mill

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ import mill.scalalib.TestModule.Utest
77
import mill.scalalib._
88
import mill.scalalib.scalafmt._
99

10-
import build.{circtlib, v}
10+
import build.{circtlib, v, ZaoziPublishModule}
1111

12-
object `package` extends RootModule with ScalaModule with ScalafmtModule { m =>
12+
object `package` extends RootModule with ScalaModule with ScalafmtModule with ZaoziPublishModule { m =>
1313
def scalaVersion = Task(v.scala)
1414
def ivyDeps = Task(Seq(v.upickle))
1515
def moduleDeps = Seq(circtlib)
16-
1716
}

rvdecoderdb/package.mill

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
// SPDX-License-Identifier: Apache-2.0
32
// SPDX-FileCopyrightText: 2025 Jiuyang Liu <liu@jiuyang.me>
43
package build.rvdecoderdb
@@ -14,7 +13,7 @@ object `package` extends RootModule with RVDecoderDB
1413

1514
trait RVDecoderDB extends ScalaModule with ScalafmtModule {
1615
def millSourcePath = os.pwd / "rvdecoderdb"
17-
override def sources: T[Seq[PathRef]] = Task.Sources { super.sources() ++ Some(PathRef(millSourcePath / "src")) }
16+
override def sources: T[Seq[PathRef]] = Task.Sources { super.sources() ++ Some(PathRef(millSourcePath / "src")) }
1817
def scalaVersion = Task(v.scala)
1918
def ivyDeps = Task(Seq(v.mainargs, v.oslib, v.upickle))
2019

zaozi/package.mill

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import $ivy.`com.lihaoyi::mill-contrib-jmh:`
1010
import contrib.jmh.JmhModule
1111
import os.Path
1212

13-
import build.{circtlib, v}
13+
import build.{circtlib, v, ZaoziPublishModule}
1414

15-
object `package` extends RootModule with ScalaModule with ScalafmtModule { m =>
15+
object `package` extends RootModule with ScalaModule with ScalafmtModule with ZaoziPublishModule { m =>
1616
def scalaVersion = Task(v.scala)
1717
def ivyDeps = Task(Seq(v.mainargs, v.oslib, v.upickle, v.sourcecode))
1818
def moduleDeps = Seq(circtlib)

0 commit comments

Comments
 (0)