Skip to content

Add publish flow #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
// SPDX-FileCopyrightText: 2025 Jiuyang Liu <[email protected]>
package build

import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.1`

import mill._
import mill.scalalib.TestModule.Utest
import mill.scalalib._
import mill.scalalib.publish._
import mill.scalalib.scalafmt._
import de.tobiasroeser.mill.vcs.version.VcsVersion
import $ivy.`com.lihaoyi::mill-contrib-jmh:`
import contrib.jmh.JmhModule
import os.Path
Expand All @@ -23,6 +27,31 @@ object v {
val jmh = "1.35"
}

trait ZaoziPublishModule extends PublishModule {
def publishVersion: mill.T[String] = VcsVersion
.vcsState()
.format(
countSep = "+",
revHashDigits = 8,
untaggedSuffix = "-SNAPSHOT"
)

def pomSettings = T(
PomSettings(
description = artifactName(),
organization = "me.jiuyang",
url = "https://github.com/sequencer/zaozi",
licenses = Seq(License.`Apache-2.0`),
versionControl = VersionControl.github("sequencer", "zaozi"),
developers = Seq(
Developer("sequencer", "Jiuyang Liu", "https://github.com/sequencer"),
Developer("unlsycn", "Yuhang Zeng", "https://github.com/unlsycn"),
Developer("Clo91eaf", "Jianhao Ye", "https://github.com/Clo91eaf")
)
)
)
}

// Panama API
trait PanamaModule extends JavaModule {
val license = Seq(
Expand Down
5 changes: 3 additions & 2 deletions circtlib/package.mill
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import mill.scalalib._
import mill.scalalib.TestModule.Utest
import mill.scalalib.scalafmt._

import build.{mlirlib, v, PanamaModule}
import build.{mlirlib, v, PanamaModule, ZaoziPublishModule}

object `package` extends RootModule with ScalaModule with ScalafmtModule with PanamaModule { outer =>
object `package` extends RootModule with ScalaModule with ScalafmtModule with PanamaModule with ZaoziPublishModule {
outer =>
def scalaVersion = Task(v.scala)

override def dumpIncludes() = Task.Command {
Expand Down
4 changes: 2 additions & 2 deletions mlirlib/package.mill
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import mill.scalalib._
import mill.scalalib.TestModule.Utest
import mill.scalalib.scalafmt._

import build.{v, PanamaModule}
import build.{v, PanamaModule, ZaoziPublishModule}

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

override def dumpIncludes() = Task.Command {
Expand Down
2 changes: 1 addition & 1 deletion nix/zaozi/zaozi.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let
passthru.millDeps = generateIvyCache {
inherit name;
src = self.src;
hash = "sha256-S5mmXOyUJMuJj4CJSdcyMyVIF6f4hgoGRfvMnWWeah4=";
hash = "sha256-C4IUEPWLyl+KCSBZeYU26aEBnHAcRRHa2BEihoXdtc8=";
};

buildInputs = passthru.millDeps.cache.ivyDepsList;
Expand Down
5 changes: 2 additions & 3 deletions omlib/package.mill
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import mill.scalalib.TestModule.Utest
import mill.scalalib._
import mill.scalalib.scalafmt._

import build.{circtlib, v}
import build.{circtlib, v, ZaoziPublishModule}

object `package` extends RootModule with ScalaModule with ScalafmtModule { m =>
object `package` extends RootModule with ScalaModule with ScalafmtModule with ZaoziPublishModule { m =>
def scalaVersion = Task(v.scala)
def ivyDeps = Task(Seq(v.upickle))
def moduleDeps = Seq(circtlib)

}
3 changes: 1 addition & 2 deletions rvdecoderdb/package.mill
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2025 Jiuyang Liu <[email protected]>
package build.rvdecoderdb
Expand All @@ -14,7 +13,7 @@ object `package` extends RootModule with RVDecoderDB

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

Expand Down
4 changes: 2 additions & 2 deletions zaozi/package.mill
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import $ivy.`com.lihaoyi::mill-contrib-jmh:`
import contrib.jmh.JmhModule
import os.Path

import build.{circtlib, v}
import build.{circtlib, v, ZaoziPublishModule}

object `package` extends RootModule with ScalaModule with ScalafmtModule { m =>
object `package` extends RootModule with ScalaModule with ScalafmtModule with ZaoziPublishModule { m =>
def scalaVersion = Task(v.scala)
def ivyDeps = Task(Seq(v.mainargs, v.oslib, v.upickle, v.sourcecode))
def moduleDeps = Seq(circtlib)
Expand Down
Loading