From bddfe775bb625a44838bb4192cd9e714e5d2e935 Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Wed, 15 Apr 2026 18:30:30 -0700 Subject: [PATCH 01/14] Add GitHub Packages publish workflow --- .github/workflows/publish.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6ca893f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,40 @@ +name: Publish Chippy package + +on: + workflow_dispatch: + push: + tags: + - "v*" + +permissions: + contents: read + packages: write + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '17' + + - name: Make Mill executable + run: chmod +x ./mill + + - name: Publish chippy to GitHub Packages + env: + MILL_MAVEN_USERNAME: ${{ github.actor }} + MILL_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + run: | + ./mill 'chippy.publishAll( + "https://maven.pkg.github.com/rohkud/chippy-forked", + release = true + )' From c8171edae713624327121a61b2ed1bcd37c8dbde Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Wed, 15 Apr 2026 18:57:50 -0700 Subject: [PATCH 02/14] Fix GitHub Packages publish workflow --- .github/workflows/publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6ca893f..8da620f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,7 +34,7 @@ jobs: MILL_MAVEN_USERNAME: ${{ github.actor }} MILL_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} run: | - ./mill 'chippy.publishAll( - "https://maven.pkg.github.com/rohkud/chippy-forked", - release = true - )' + ./mill mill.javalib.MavenPublishModule/ \ + --publishArtifacts chippy.publishArtifacts \ + --releaseUri https://maven.pkg.github.com/rohkud/chippy-forked \ + --snapshotUri https://maven.pkg.github.com/rohkud/chippy-forked From 7fd8086a50579bd19755158aef57af978743bbbe Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Tue, 21 Apr 2026 19:19:35 -0700 Subject: [PATCH 03/14] test file to see if package can be used (please work) --- chippy-test/build.mill | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 chippy-test/build.mill diff --git a/chippy-test/build.mill b/chippy-test/build.mill new file mode 100644 index 0000000..81c5e4f --- /dev/null +++ b/chippy-test/build.mill @@ -0,0 +1,14 @@ +import mill._ +import mill.scalalib._ + +object test extends ScalaModule { + def scalaVersion = "2.13.16" + + def repositories = Seq( + MavenRepository("https://maven.pkg.github.com/rohkud/chippy-forked") + ) + + def ivyDeps = Agg( + ivy"edu.berkeley.cs::chippy:0.0.1" + ) +} From 6a48dcc46dc25ce085d09bcc56ead08c9d0848d4 Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Tue, 21 Apr 2026 19:56:56 -0700 Subject: [PATCH 04/14] Also publish diplomacy --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8da620f..b161827 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,6 +35,6 @@ jobs: MILL_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} run: | ./mill mill.javalib.MavenPublishModule/ \ - --publishArtifacts chippy.publishArtifacts \ + --publishArtifacts chippy.publishArtifacts rocketchip.dependencies.diplomacy.publishArtifacts \ --releaseUri https://maven.pkg.github.com/rohkud/chippy-forked \ --snapshotUri https://maven.pkg.github.com/rohkud/chippy-forked From 5fb09ad1dda5139e9889e454354f03f8a77762b4 Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Tue, 21 Apr 2026 20:02:26 -0700 Subject: [PATCH 05/14] Fixed buildmill file --- chippy-test/build.mill | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chippy-test/build.mill b/chippy-test/build.mill index 81c5e4f..17ac060 100644 --- a/chippy-test/build.mill +++ b/chippy-test/build.mill @@ -5,10 +5,10 @@ object test extends ScalaModule { def scalaVersion = "2.13.16" def repositories = Seq( - MavenRepository("https://maven.pkg.github.com/rohkud/chippy-forked") + "https://maven.pkg.github.com/rohkud/chippy-forked" ) - def ivyDeps = Agg( - ivy"edu.berkeley.cs::chippy:0.0.1" + def ivyDeps = Seq( + mvn"edu.berkeley.cs::chippy:0.0.1" ) } From 7f5348b201d7d9f8cd527bf1d5bdf789f5600fcc Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Tue, 21 Apr 2026 20:07:34 -0700 Subject: [PATCH 06/14] Fixed publish syntax --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b161827..74d3184 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,6 +35,6 @@ jobs: MILL_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} run: | ./mill mill.javalib.MavenPublishModule/ \ - --publishArtifacts chippy.publishArtifacts rocketchip.dependencies.diplomacy.publishArtifacts \ + --publishArtifacts chippy.publishArtifacts,rocketchip.dependencies.diplomacy.publishArtifacts \ --releaseUri https://maven.pkg.github.com/rohkud/chippy-forked \ --snapshotUri https://maven.pkg.github.com/rohkud/chippy-forked From 5e152d4395302ec2b23fd11d7e76e65a49c83cf0 Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Tue, 21 Apr 2026 20:30:28 -0700 Subject: [PATCH 07/14] Multiple publish syntax doesnt work, so everything needs to be published --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 74d3184..a3ca30b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,6 +35,5 @@ jobs: MILL_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} run: | ./mill mill.javalib.MavenPublishModule/ \ - --publishArtifacts chippy.publishArtifacts,rocketchip.dependencies.diplomacy.publishArtifacts \ --releaseUri https://maven.pkg.github.com/rohkud/chippy-forked \ --snapshotUri https://maven.pkg.github.com/rohkud/chippy-forked From c457e5d06e4f259d0623eb128c8c7fb157c67712 Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Tue, 21 Apr 2026 20:38:30 -0700 Subject: [PATCH 08/14] Increment publish versions to 0.0.2(to fix the 0.0.1 collision with chippy package) --- build.mill | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/build.mill b/build.mill index bd81bf4..87b2fbb 100644 --- a/build.mill +++ b/build.mill @@ -32,7 +32,7 @@ trait ChippyPublishModule extends ChippyModule, PublishModule { } object rocketchip extends ChippyPublishModule { - def publishVersion = "0.0.1" + def publishVersion = "0.0.2" def moduleDir = super.moduleDir / os.up / "rocket-chip" def resources = Task.Sources { moduleDir / "src" / "main" / "resources" } @@ -52,7 +52,7 @@ object rocketchip extends ChippyPublishModule { def pomSettings = makePomSettings("Hardware floating-point units written in Chisel.") object macros extends ChippyPublishModule { - def publishVersion = "0.0.1" + def publishVersion = "0.0.2" def mvnDeps = Seq( mvn"org.scala-lang:scala-reflect:${scalaVersion}", @@ -63,7 +63,7 @@ object rocketchip extends ChippyPublishModule { object dependencies extends Module { object cde extends ChippyPublishModule { - def publishVersion = "0.0.1" + def publishVersion = "0.0.2" def artifactName = "cde" def sources = Task.Sources(this.moduleDir / "cde" / "src") @@ -80,7 +80,7 @@ object rocketchip extends ChippyPublishModule { } object diplomacy extends ChippyPublishModule { - def publishVersion = "0.0.1" + def publishVersion = "0.0.2" def artifactName = "diplomacy" def sources = Task.Sources(this.moduleDir / "diplomacy" / "src") @@ -99,7 +99,7 @@ object rocketchip extends ChippyPublishModule { } object hardfloat extends ChippyPublishModule { - def publishVersion = "0.0.1" + def publishVersion = "0.0.2" def artifactName = "hardfloat" def sources = Task.Sources(this.moduleDir / "hardfloat" / "src") @@ -127,7 +127,7 @@ object rocketchip extends ChippyPublishModule { } object `rocketchip-blocks` extends ChippyPublishModule { - def publishVersion = "0.0.1" + def publishVersion = "0.0.2" def moduleDir = super.moduleDir / os.up / "rocket-chip-blocks" @@ -144,7 +144,7 @@ object `rocketchip-blocks` extends ChippyPublishModule { } object `rocketchip-inclusive-cache` extends ChippyPublishModule { - def publishVersion = "0.0.1" + def publishVersion = "0.0.2" def moduleDir = super.moduleDir / os.up / "rocket-chip-inclusive-cache" def sources = Task.Sources(moduleDir / "design" / "craft" / "inclusivecache") @@ -162,7 +162,7 @@ object `rocketchip-inclusive-cache` extends ChippyPublishModule { } object testchipip extends ChippyPublishModule { - def publishVersion = "0.0.1" + def publishVersion = "0.0.2" def resources = Task.Sources { moduleDir / "src" / "main" / "resources" } @@ -179,7 +179,7 @@ object testchipip extends ChippyPublishModule { } object constellation extends ChippyPublishModule { - def publishVersion = "0.0.1" + def publishVersion = "0.0.2" def sources = Task.Sources(this.moduleDir / "src" / "main") @@ -204,7 +204,7 @@ object constellation extends ChippyPublishModule { } object chippy extends ChippyPublishModule { - def publishVersion = "0.0.1" + def publishVersion = "0.0.2" def moduleDeps = Seq(rocketchip.dependencies.cde, rocketchip.dependencies.diplomacy, rocketchip) @@ -219,7 +219,7 @@ object chippy extends ChippyPublishModule { } object chipyard extends ChippyPublishModule { - def publishVersion = "0.0.1" + def publishVersion = "0.0.2" def sources = Task.Sources(this.moduleDir / "src" / "main") def resources = Task.Sources { moduleDir / "src" / "main" / "resources" } From 4beb9e412dffbd5fa3360a1d10361ec6d63b6827 Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Tue, 21 Apr 2026 23:43:55 -0700 Subject: [PATCH 09/14] added a small test file to prove that we could consume the packages that we published to GH packages. (it worked) --- chippy-test/build.mill | 4 +- chippy-test/mill | 199 ++++++++++++++++++++++++++++++++ chippy-test/test/src/Main.scala | 8 ++ 3 files changed, 209 insertions(+), 2 deletions(-) create mode 100755 chippy-test/mill create mode 100644 chippy-test/test/src/Main.scala diff --git a/chippy-test/build.mill b/chippy-test/build.mill index 17ac060..162565e 100644 --- a/chippy-test/build.mill +++ b/chippy-test/build.mill @@ -8,7 +8,7 @@ object test extends ScalaModule { "https://maven.pkg.github.com/rohkud/chippy-forked" ) - def ivyDeps = Seq( - mvn"edu.berkeley.cs::chippy:0.0.1" + def mvnDeps = Seq( + mvn"edu.berkeley.cs::diplomacy:0.0.2" ) } diff --git a/chippy-test/mill b/chippy-test/mill new file mode 100755 index 0000000..bc04bdc --- /dev/null +++ b/chippy-test/mill @@ -0,0 +1,199 @@ +#!/usr/bin/env sh + +set -e + +if [ -z "${DEFAULT_MILL_VERSION}" ] ; then DEFAULT_MILL_VERSION="1.1.2"; fi + +if [ -z "${GITHUB_RELEASE_CDN}" ] ; then GITHUB_RELEASE_CDN=""; fi + +if [ -z "$MILL_MAIN_CLI" ] ; then MILL_MAIN_CLI="${0}"; fi + +MILL_REPO_URL="https://github.com/com-lihaoyi/mill" + +MILL_BUILD_SCRIPT="" + +if [ -f "build.mill" ] ; then + MILL_BUILD_SCRIPT="build.mill" +elif [ -f "build.mill.scala" ] ; then + MILL_BUILD_SCRIPT="build.mill.scala" +elif [ -f "build.sc" ] ; then + MILL_BUILD_SCRIPT="build.sc" +fi + +# `s/.*://`: +# This is a greedy match that removes everything from the beginning of the line up to (and including) the last +# colon (:). This effectively isolates the value part of the declaration. +# +# `s/#.*//`: +# This removes any comments at the end of the line. +# +# `s/['\"]//g`: +# This removes all single and double quotes from the string, wherever they appear (g is for "global"). +# +# `s/^[[:space:]]*//; s/[[:space:]]*$//`: +# These two expressions trim any leading or trailing whitespace ([[:space:]] matches spaces and tabs). +TRIM_VALUE_SED="s/.*://; s/#.*//; s/['\"]//g; s/^[[:space:]]*//; s/[[:space:]]*$//" + +if [ -z "${MILL_VERSION}" ] ; then + if [ -f ".mill-version" ] ; then + MILL_VERSION="$(tr '\r' '\n' < .mill-version | head -n 1 2> /dev/null)" + elif [ -f ".config/mill-version" ] ; then + MILL_VERSION="$(tr '\r' '\n' < .config/mill-version | head -n 1 2> /dev/null)" + elif [ -f "build.mill.yaml" ] ; then + MILL_VERSION="$(grep -E "mill-version:" "build.mill.yaml" | sed -E "$TRIM_VALUE_SED")" + elif [ -n "${MILL_BUILD_SCRIPT}" ] ; then + MILL_VERSION="$(grep -E "//\|.*mill-version" "${MILL_BUILD_SCRIPT}" | sed -E "$TRIM_VALUE_SED")" + fi +fi + +if [ -z "${MILL_VERSION}" ] ; then MILL_VERSION="${DEFAULT_MILL_VERSION}"; fi + +MILL_USER_CACHE_DIR="${XDG_CACHE_HOME:-${HOME}/.cache}/mill" + +if [ -z "${MILL_FINAL_DOWNLOAD_FOLDER}" ] ; then MILL_FINAL_DOWNLOAD_FOLDER="${MILL_USER_CACHE_DIR}/download"; fi + +MILL_NATIVE_SUFFIX="-native" +MILL_JVM_SUFFIX="-jvm" +ARTIFACT_SUFFIX="" + +# Check if GLIBC version is at least the required version +# Returns 0 (true) if GLIBC >= required version, 1 (false) otherwise +check_glibc_version() { + required_version="2.39" + required_major=$(echo "$required_version" | cut -d. -f1) + required_minor=$(echo "$required_version" | cut -d. -f2) + # Get GLIBC version from ldd --version (first line contains version like "ldd (GNU libc) 2.31") + glibc_version=$(ldd --version 2>/dev/null | head -n 1 | grep -oE '[0-9]+\.[0-9]+$' || echo "") + if [ -z "$glibc_version" ]; then + # If we can't determine GLIBC version, assume it's too old + return 1 + fi + glibc_major=$(echo "$glibc_version" | cut -d. -f1) + glibc_minor=$(echo "$glibc_version" | cut -d. -f2) + if [ "$glibc_major" -gt "$required_major" ]; then + return 0 + elif [ "$glibc_major" -eq "$required_major" ] && [ "$glibc_minor" -ge "$required_minor" ]; then + return 0 + else + return 1 + fi +} + +set_artifact_suffix() { + if [ "$(uname -s 2>/dev/null | cut -c 1-5)" = "Linux" ]; then + # Native binaries require new enough GLIBC; fall back to JVM launcher if older + if ! check_glibc_version; then + return + fi + if [ "$(uname -m)" = "aarch64" ]; then ARTIFACT_SUFFIX="-native-linux-aarch64" + else ARTIFACT_SUFFIX="-native-linux-amd64"; fi + elif [ "$(uname)" = "Darwin" ]; then + if [ "$(uname -m)" = "arm64" ]; then ARTIFACT_SUFFIX="-native-mac-aarch64" + else ARTIFACT_SUFFIX="-native-mac-amd64"; fi + else + echo "This native mill launcher supports only Linux and macOS." 1>&2 + exit 1 + fi +} + +case "$MILL_VERSION" in + *"$MILL_NATIVE_SUFFIX") + MILL_VERSION=${MILL_VERSION%"$MILL_NATIVE_SUFFIX"} + set_artifact_suffix + ;; + + *"$MILL_JVM_SUFFIX") + MILL_VERSION=${MILL_VERSION%"$MILL_JVM_SUFFIX"} + ;; + + *) + case "$MILL_VERSION" in + 0.1.* | 0.2.* | 0.3.* | 0.4.* | 0.5.* | 0.6.* | 0.7.* | 0.8.* | 0.9.* | 0.10.* | 0.11.* | 0.12.*) + ;; + *) + set_artifact_suffix + ;; + esac + ;; +esac + +MILL="${MILL_FINAL_DOWNLOAD_FOLDER}/$MILL_VERSION$ARTIFACT_SUFFIX" + +# If not already downloaded, download it +if [ ! -s "${MILL}" ] || [ "$MILL_TEST_DRY_RUN_LAUNCHER_SCRIPT" = "1" ] ; then + case $MILL_VERSION in + 0.0.* | 0.1.* | 0.2.* | 0.3.* | 0.4.*) + MILL_DOWNLOAD_SUFFIX="" + MILL_DOWNLOAD_FROM_MAVEN=0 + ;; + 0.5.* | 0.6.* | 0.7.* | 0.8.* | 0.9.* | 0.10.* | 0.11.0-M*) + MILL_DOWNLOAD_SUFFIX="-assembly" + MILL_DOWNLOAD_FROM_MAVEN=0 + ;; + *) + MILL_DOWNLOAD_SUFFIX="-assembly" + MILL_DOWNLOAD_FROM_MAVEN=1 + ;; + esac + case $MILL_VERSION in + 0.12.0 | 0.12.1 | 0.12.2 | 0.12.3 | 0.12.4 | 0.12.5 | 0.12.6 | 0.12.7 | 0.12.8 | 0.12.9 | 0.12.10 | 0.12.11) + MILL_DOWNLOAD_EXT="jar" + ;; + 0.12.*) + MILL_DOWNLOAD_EXT="exe" + ;; + 0.*) + MILL_DOWNLOAD_EXT="jar" + ;; + *) + MILL_DOWNLOAD_EXT="exe" + ;; + esac + + MILL_TEMP_DOWNLOAD_FILE="${MILL_OUTPUT_DIR:-out}/mill-temp-download" + mkdir -p "$(dirname "${MILL_TEMP_DOWNLOAD_FILE}")" + + if [ "$MILL_DOWNLOAD_FROM_MAVEN" = "1" ] ; then + MILL_DOWNLOAD_URL="https://repo1.maven.org/maven2/com/lihaoyi/mill-dist${ARTIFACT_SUFFIX}/${MILL_VERSION}/mill-dist${ARTIFACT_SUFFIX}-${MILL_VERSION}.${MILL_DOWNLOAD_EXT}" + else + MILL_VERSION_TAG=$(echo "$MILL_VERSION" | sed -E 's/([^-]+)(-M[0-9]+)?(-.*)?/\1\2/') + MILL_DOWNLOAD_URL="${GITHUB_RELEASE_CDN}${MILL_REPO_URL}/releases/download/${MILL_VERSION_TAG}/${MILL_VERSION}${MILL_DOWNLOAD_SUFFIX}" + unset MILL_VERSION_TAG + fi + + + if [ "$MILL_TEST_DRY_RUN_LAUNCHER_SCRIPT" = "1" ] ; then + echo "$MILL_DOWNLOAD_URL" + echo "$MILL" + exit 0 + fi + + echo "Downloading mill ${MILL_VERSION} from ${MILL_DOWNLOAD_URL} ..." 1>&2 + curl -f -L -o "${MILL_TEMP_DOWNLOAD_FILE}" "${MILL_DOWNLOAD_URL}" + + chmod +x "${MILL_TEMP_DOWNLOAD_FILE}" + + mkdir -p "${MILL_FINAL_DOWNLOAD_FOLDER}" + mv "${MILL_TEMP_DOWNLOAD_FILE}" "${MILL}" + + unset MILL_TEMP_DOWNLOAD_FILE + unset MILL_DOWNLOAD_SUFFIX +fi + +MILL_FIRST_ARG="" +if [ "$1" = "--bsp" ] || [ "${1#"-i"}" != "$1" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--no-daemon" ] || [ "$1" = "--help" ] ; then + # Need to preserve the first position of those listed options + MILL_FIRST_ARG=$1 + shift +fi + +unset MILL_FINAL_DOWNLOAD_FOLDER +unset MILL_OLD_DOWNLOAD_PATH +unset OLD_MILL +unset MILL_VERSION +unset MILL_REPO_URL + +# -D mill.main.cli is for compatibility with Mill 0.10.9 - 0.13.0-M2 +# We don't quote MILL_FIRST_ARG on purpose, so we can expand the empty value without quotes +# shellcheck disable=SC2086 +exec "${MILL}" $MILL_FIRST_ARG -D "mill.main.cli=${MILL_MAIN_CLI}" "$@" diff --git a/chippy-test/test/src/Main.scala b/chippy-test/test/src/Main.scala new file mode 100644 index 0000000..0866fb7 --- /dev/null +++ b/chippy-test/test/src/Main.scala @@ -0,0 +1,8 @@ +import org.chipsalliance.diplomacy.lazymodule.LazyModule + +object Main { + def main(args: Array[String]): Unit = { + val x: Option[LazyModule] = None + println("Successfully imported diplomacy: " + x) + } +} From cf6453d7e4e4b1a30fac08cb65c5dcf2f685dfa0 Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Thu, 30 Apr 2026 16:18:25 -0700 Subject: [PATCH 10/14] Parameterized publishing?? --- .github/workflows/publish.yml | 22 ++++++++++++++++------ build.mill | 22 +++++++++++----------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a3ca30b..a7a4040 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,9 +2,14 @@ name: Publish Chippy package on: workflow_dispatch: - push: - tags: - - "v*" + inputs: + module: + description: "Module to publish, e.g. diplomacy, chippy, rocketchip" + required: true + default: diplomacy + version: + description: "Version to publish, e.g. 3.0.0" + required: true permissions: contents: read @@ -24,16 +29,21 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin - java-version: '17' + java-version: "17" - name: Make Mill executable run: chmod +x ./mill - - name: Publish chippy to GitHub Packages + - name: Set module and version + run: | + echo "MODULE=${{ github.event.inputs.module }}" >> $GITHUB_ENV + echo "CHIPPY_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + + - name: Publish selected module env: MILL_MAVEN_USERNAME: ${{ github.actor }} MILL_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} run: | - ./mill mill.javalib.MavenPublishModule/ \ + ./mill $MODULE.publish \ --releaseUri https://maven.pkg.github.com/rohkud/chippy-forked \ --snapshotUri https://maven.pkg.github.com/rohkud/chippy-forked diff --git a/build.mill b/build.mill index 87b2fbb..bc7a6b5 100644 --- a/build.mill +++ b/build.mill @@ -32,7 +32,7 @@ trait ChippyPublishModule extends ChippyModule, PublishModule { } object rocketchip extends ChippyPublishModule { - def publishVersion = "0.0.2" + def publishVersion = sys.env.getOrElse("CHIPPY_VERSION", "LOCAL-SNAPSHOT") def moduleDir = super.moduleDir / os.up / "rocket-chip" def resources = Task.Sources { moduleDir / "src" / "main" / "resources" } @@ -52,7 +52,7 @@ object rocketchip extends ChippyPublishModule { def pomSettings = makePomSettings("Hardware floating-point units written in Chisel.") object macros extends ChippyPublishModule { - def publishVersion = "0.0.2" + def publishVersion = sys.env.getOrElse("CHIPPY_VERSION", "LOCAL-SNAPSHOT") def mvnDeps = Seq( mvn"org.scala-lang:scala-reflect:${scalaVersion}", @@ -63,7 +63,7 @@ object rocketchip extends ChippyPublishModule { object dependencies extends Module { object cde extends ChippyPublishModule { - def publishVersion = "0.0.2" + def publishVersion = sys.env.getOrElse("CHIPPY_VERSION", "LOCAL-SNAPSHOT") def artifactName = "cde" def sources = Task.Sources(this.moduleDir / "cde" / "src") @@ -80,7 +80,7 @@ object rocketchip extends ChippyPublishModule { } object diplomacy extends ChippyPublishModule { - def publishVersion = "0.0.2" + def publishVersion = sys.env.getOrElse("CHIPPY_VERSION", "LOCAL-SNAPSHOT") def artifactName = "diplomacy" def sources = Task.Sources(this.moduleDir / "diplomacy" / "src") @@ -99,7 +99,7 @@ object rocketchip extends ChippyPublishModule { } object hardfloat extends ChippyPublishModule { - def publishVersion = "0.0.2" + def publishVersion = sys.env.getOrElse("CHIPPY_VERSION", "LOCAL-SNAPSHOT") def artifactName = "hardfloat" def sources = Task.Sources(this.moduleDir / "hardfloat" / "src") @@ -127,7 +127,7 @@ object rocketchip extends ChippyPublishModule { } object `rocketchip-blocks` extends ChippyPublishModule { - def publishVersion = "0.0.2" + def publishVersion = sys.env.getOrElse("CHIPPY_VERSION", "LOCAL-SNAPSHOT") def moduleDir = super.moduleDir / os.up / "rocket-chip-blocks" @@ -144,7 +144,7 @@ object `rocketchip-blocks` extends ChippyPublishModule { } object `rocketchip-inclusive-cache` extends ChippyPublishModule { - def publishVersion = "0.0.2" + def publishVersion = sys.env.getOrElse("CHIPPY_VERSION", "LOCAL-SNAPSHOT") def moduleDir = super.moduleDir / os.up / "rocket-chip-inclusive-cache" def sources = Task.Sources(moduleDir / "design" / "craft" / "inclusivecache") @@ -162,7 +162,7 @@ object `rocketchip-inclusive-cache` extends ChippyPublishModule { } object testchipip extends ChippyPublishModule { - def publishVersion = "0.0.2" + def publishVersion = sys.env.getOrElse("CHIPPY_VERSION", "LOCAL-SNAPSHOT") def resources = Task.Sources { moduleDir / "src" / "main" / "resources" } @@ -179,7 +179,7 @@ object testchipip extends ChippyPublishModule { } object constellation extends ChippyPublishModule { - def publishVersion = "0.0.2" + def publishVersion = sys.env.getOrElse("CHIPPY_VERSION", "LOCAL-SNAPSHOT") def sources = Task.Sources(this.moduleDir / "src" / "main") @@ -204,7 +204,7 @@ object constellation extends ChippyPublishModule { } object chippy extends ChippyPublishModule { - def publishVersion = "0.0.2" + def publishVersion = sys.env.getOrElse("CHIPPY_VERSION", "LOCAL-SNAPSHOT") def moduleDeps = Seq(rocketchip.dependencies.cde, rocketchip.dependencies.diplomacy, rocketchip) @@ -219,7 +219,7 @@ object chippy extends ChippyPublishModule { } object chipyard extends ChippyPublishModule { - def publishVersion = "0.0.2" + def publishVersion = sys.env.getOrElse("CHIPPY_VERSION", "LOCAL-SNAPSHOT") def sources = Task.Sources(this.moduleDir / "src" / "main") def resources = Task.Sources { moduleDir / "src" / "main" / "resources" } From d7d9561cbcc4fa7ad653086349341244c488a1a6 Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Thu, 30 Apr 2026 18:42:27 -0700 Subject: [PATCH 11/14] Fixed publish file --- .github/workflows/publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a7a4040..f26e094 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -44,6 +44,7 @@ jobs: MILL_MAVEN_USERNAME: ${{ github.actor }} MILL_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} run: | - ./mill $MODULE.publish \ + ./mill mill.javalib.MavenPublishModule/ \ + --publishArtifacts "$MODULE.publishArtifacts" \ --releaseUri https://maven.pkg.github.com/rohkud/chippy-forked \ --snapshotUri https://maven.pkg.github.com/rohkud/chippy-forked From 67bbd9a648d077e0bb205aa5678cbb1a951341f1 Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Thu, 30 Apr 2026 18:55:19 -0700 Subject: [PATCH 12/14] Improved GH actions instructions for user --- .github/workflows/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f26e094..e0a5f4a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,9 +4,9 @@ on: workflow_dispatch: inputs: module: - description: "Module to publish, e.g. diplomacy, chippy, rocketchip" + description: "Module to publish, e.g. rocketchip.dependencies.diplomacy, chippy, rocketchip. Look at documentation for more details: https://rohkud.github.io/chippy/available-packages/" required: true - default: diplomacy + default: rocketchip.dependencies.diplomacy version: description: "Version to publish, e.g. 3.0.0" required: true From f7ba75ea615ad3439c70557c5e1196adda785b5b Mon Sep 17 00:00:00 2001 From: rohankudchadker Date: Fri, 1 May 2026 15:52:10 -0700 Subject: [PATCH 13/14] use latest version of actions checkout and setup-java --- .github/workflows/publish.yml | 4 +- chippy-test/build.mill | 14 --- chippy-test/mill | 199 -------------------------------- chippy-test/test/src/Main.scala | 8 -- 4 files changed, 2 insertions(+), 223 deletions(-) delete mode 100644 chippy-test/build.mill delete mode 100755 chippy-test/mill delete mode 100644 chippy-test/test/src/Main.scala diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e0a5f4a..fc819df 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,12 +21,12 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: submodules: recursive - name: Set up JDK - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: temurin java-version: "17" diff --git a/chippy-test/build.mill b/chippy-test/build.mill deleted file mode 100644 index 162565e..0000000 --- a/chippy-test/build.mill +++ /dev/null @@ -1,14 +0,0 @@ -import mill._ -import mill.scalalib._ - -object test extends ScalaModule { - def scalaVersion = "2.13.16" - - def repositories = Seq( - "https://maven.pkg.github.com/rohkud/chippy-forked" - ) - - def mvnDeps = Seq( - mvn"edu.berkeley.cs::diplomacy:0.0.2" - ) -} diff --git a/chippy-test/mill b/chippy-test/mill deleted file mode 100755 index bc04bdc..0000000 --- a/chippy-test/mill +++ /dev/null @@ -1,199 +0,0 @@ -#!/usr/bin/env sh - -set -e - -if [ -z "${DEFAULT_MILL_VERSION}" ] ; then DEFAULT_MILL_VERSION="1.1.2"; fi - -if [ -z "${GITHUB_RELEASE_CDN}" ] ; then GITHUB_RELEASE_CDN=""; fi - -if [ -z "$MILL_MAIN_CLI" ] ; then MILL_MAIN_CLI="${0}"; fi - -MILL_REPO_URL="https://github.com/com-lihaoyi/mill" - -MILL_BUILD_SCRIPT="" - -if [ -f "build.mill" ] ; then - MILL_BUILD_SCRIPT="build.mill" -elif [ -f "build.mill.scala" ] ; then - MILL_BUILD_SCRIPT="build.mill.scala" -elif [ -f "build.sc" ] ; then - MILL_BUILD_SCRIPT="build.sc" -fi - -# `s/.*://`: -# This is a greedy match that removes everything from the beginning of the line up to (and including) the last -# colon (:). This effectively isolates the value part of the declaration. -# -# `s/#.*//`: -# This removes any comments at the end of the line. -# -# `s/['\"]//g`: -# This removes all single and double quotes from the string, wherever they appear (g is for "global"). -# -# `s/^[[:space:]]*//; s/[[:space:]]*$//`: -# These two expressions trim any leading or trailing whitespace ([[:space:]] matches spaces and tabs). -TRIM_VALUE_SED="s/.*://; s/#.*//; s/['\"]//g; s/^[[:space:]]*//; s/[[:space:]]*$//" - -if [ -z "${MILL_VERSION}" ] ; then - if [ -f ".mill-version" ] ; then - MILL_VERSION="$(tr '\r' '\n' < .mill-version | head -n 1 2> /dev/null)" - elif [ -f ".config/mill-version" ] ; then - MILL_VERSION="$(tr '\r' '\n' < .config/mill-version | head -n 1 2> /dev/null)" - elif [ -f "build.mill.yaml" ] ; then - MILL_VERSION="$(grep -E "mill-version:" "build.mill.yaml" | sed -E "$TRIM_VALUE_SED")" - elif [ -n "${MILL_BUILD_SCRIPT}" ] ; then - MILL_VERSION="$(grep -E "//\|.*mill-version" "${MILL_BUILD_SCRIPT}" | sed -E "$TRIM_VALUE_SED")" - fi -fi - -if [ -z "${MILL_VERSION}" ] ; then MILL_VERSION="${DEFAULT_MILL_VERSION}"; fi - -MILL_USER_CACHE_DIR="${XDG_CACHE_HOME:-${HOME}/.cache}/mill" - -if [ -z "${MILL_FINAL_DOWNLOAD_FOLDER}" ] ; then MILL_FINAL_DOWNLOAD_FOLDER="${MILL_USER_CACHE_DIR}/download"; fi - -MILL_NATIVE_SUFFIX="-native" -MILL_JVM_SUFFIX="-jvm" -ARTIFACT_SUFFIX="" - -# Check if GLIBC version is at least the required version -# Returns 0 (true) if GLIBC >= required version, 1 (false) otherwise -check_glibc_version() { - required_version="2.39" - required_major=$(echo "$required_version" | cut -d. -f1) - required_minor=$(echo "$required_version" | cut -d. -f2) - # Get GLIBC version from ldd --version (first line contains version like "ldd (GNU libc) 2.31") - glibc_version=$(ldd --version 2>/dev/null | head -n 1 | grep -oE '[0-9]+\.[0-9]+$' || echo "") - if [ -z "$glibc_version" ]; then - # If we can't determine GLIBC version, assume it's too old - return 1 - fi - glibc_major=$(echo "$glibc_version" | cut -d. -f1) - glibc_minor=$(echo "$glibc_version" | cut -d. -f2) - if [ "$glibc_major" -gt "$required_major" ]; then - return 0 - elif [ "$glibc_major" -eq "$required_major" ] && [ "$glibc_minor" -ge "$required_minor" ]; then - return 0 - else - return 1 - fi -} - -set_artifact_suffix() { - if [ "$(uname -s 2>/dev/null | cut -c 1-5)" = "Linux" ]; then - # Native binaries require new enough GLIBC; fall back to JVM launcher if older - if ! check_glibc_version; then - return - fi - if [ "$(uname -m)" = "aarch64" ]; then ARTIFACT_SUFFIX="-native-linux-aarch64" - else ARTIFACT_SUFFIX="-native-linux-amd64"; fi - elif [ "$(uname)" = "Darwin" ]; then - if [ "$(uname -m)" = "arm64" ]; then ARTIFACT_SUFFIX="-native-mac-aarch64" - else ARTIFACT_SUFFIX="-native-mac-amd64"; fi - else - echo "This native mill launcher supports only Linux and macOS." 1>&2 - exit 1 - fi -} - -case "$MILL_VERSION" in - *"$MILL_NATIVE_SUFFIX") - MILL_VERSION=${MILL_VERSION%"$MILL_NATIVE_SUFFIX"} - set_artifact_suffix - ;; - - *"$MILL_JVM_SUFFIX") - MILL_VERSION=${MILL_VERSION%"$MILL_JVM_SUFFIX"} - ;; - - *) - case "$MILL_VERSION" in - 0.1.* | 0.2.* | 0.3.* | 0.4.* | 0.5.* | 0.6.* | 0.7.* | 0.8.* | 0.9.* | 0.10.* | 0.11.* | 0.12.*) - ;; - *) - set_artifact_suffix - ;; - esac - ;; -esac - -MILL="${MILL_FINAL_DOWNLOAD_FOLDER}/$MILL_VERSION$ARTIFACT_SUFFIX" - -# If not already downloaded, download it -if [ ! -s "${MILL}" ] || [ "$MILL_TEST_DRY_RUN_LAUNCHER_SCRIPT" = "1" ] ; then - case $MILL_VERSION in - 0.0.* | 0.1.* | 0.2.* | 0.3.* | 0.4.*) - MILL_DOWNLOAD_SUFFIX="" - MILL_DOWNLOAD_FROM_MAVEN=0 - ;; - 0.5.* | 0.6.* | 0.7.* | 0.8.* | 0.9.* | 0.10.* | 0.11.0-M*) - MILL_DOWNLOAD_SUFFIX="-assembly" - MILL_DOWNLOAD_FROM_MAVEN=0 - ;; - *) - MILL_DOWNLOAD_SUFFIX="-assembly" - MILL_DOWNLOAD_FROM_MAVEN=1 - ;; - esac - case $MILL_VERSION in - 0.12.0 | 0.12.1 | 0.12.2 | 0.12.3 | 0.12.4 | 0.12.5 | 0.12.6 | 0.12.7 | 0.12.8 | 0.12.9 | 0.12.10 | 0.12.11) - MILL_DOWNLOAD_EXT="jar" - ;; - 0.12.*) - MILL_DOWNLOAD_EXT="exe" - ;; - 0.*) - MILL_DOWNLOAD_EXT="jar" - ;; - *) - MILL_DOWNLOAD_EXT="exe" - ;; - esac - - MILL_TEMP_DOWNLOAD_FILE="${MILL_OUTPUT_DIR:-out}/mill-temp-download" - mkdir -p "$(dirname "${MILL_TEMP_DOWNLOAD_FILE}")" - - if [ "$MILL_DOWNLOAD_FROM_MAVEN" = "1" ] ; then - MILL_DOWNLOAD_URL="https://repo1.maven.org/maven2/com/lihaoyi/mill-dist${ARTIFACT_SUFFIX}/${MILL_VERSION}/mill-dist${ARTIFACT_SUFFIX}-${MILL_VERSION}.${MILL_DOWNLOAD_EXT}" - else - MILL_VERSION_TAG=$(echo "$MILL_VERSION" | sed -E 's/([^-]+)(-M[0-9]+)?(-.*)?/\1\2/') - MILL_DOWNLOAD_URL="${GITHUB_RELEASE_CDN}${MILL_REPO_URL}/releases/download/${MILL_VERSION_TAG}/${MILL_VERSION}${MILL_DOWNLOAD_SUFFIX}" - unset MILL_VERSION_TAG - fi - - - if [ "$MILL_TEST_DRY_RUN_LAUNCHER_SCRIPT" = "1" ] ; then - echo "$MILL_DOWNLOAD_URL" - echo "$MILL" - exit 0 - fi - - echo "Downloading mill ${MILL_VERSION} from ${MILL_DOWNLOAD_URL} ..." 1>&2 - curl -f -L -o "${MILL_TEMP_DOWNLOAD_FILE}" "${MILL_DOWNLOAD_URL}" - - chmod +x "${MILL_TEMP_DOWNLOAD_FILE}" - - mkdir -p "${MILL_FINAL_DOWNLOAD_FOLDER}" - mv "${MILL_TEMP_DOWNLOAD_FILE}" "${MILL}" - - unset MILL_TEMP_DOWNLOAD_FILE - unset MILL_DOWNLOAD_SUFFIX -fi - -MILL_FIRST_ARG="" -if [ "$1" = "--bsp" ] || [ "${1#"-i"}" != "$1" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--no-daemon" ] || [ "$1" = "--help" ] ; then - # Need to preserve the first position of those listed options - MILL_FIRST_ARG=$1 - shift -fi - -unset MILL_FINAL_DOWNLOAD_FOLDER -unset MILL_OLD_DOWNLOAD_PATH -unset OLD_MILL -unset MILL_VERSION -unset MILL_REPO_URL - -# -D mill.main.cli is for compatibility with Mill 0.10.9 - 0.13.0-M2 -# We don't quote MILL_FIRST_ARG on purpose, so we can expand the empty value without quotes -# shellcheck disable=SC2086 -exec "${MILL}" $MILL_FIRST_ARG -D "mill.main.cli=${MILL_MAIN_CLI}" "$@" diff --git a/chippy-test/test/src/Main.scala b/chippy-test/test/src/Main.scala deleted file mode 100644 index 0866fb7..0000000 --- a/chippy-test/test/src/Main.scala +++ /dev/null @@ -1,8 +0,0 @@ -import org.chipsalliance.diplomacy.lazymodule.LazyModule - -object Main { - def main(args: Array[String]): Unit = { - val x: Option[LazyModule] = None - println("Successfully imported diplomacy: " + x) - } -} From 65ae06f7151ba38d2898796c57ef1de63bcdc7fb Mon Sep 17 00:00:00 2001 From: rohkud Date: Fri, 1 May 2026 16:32:58 -0700 Subject: [PATCH 14/14] Changed links in publish.yml --- .github/workflows/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fc819df..ea2da46 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -46,5 +46,5 @@ jobs: run: | ./mill mill.javalib.MavenPublishModule/ \ --publishArtifacts "$MODULE.publishArtifacts" \ - --releaseUri https://maven.pkg.github.com/rohkud/chippy-forked \ - --snapshotUri https://maven.pkg.github.com/rohkud/chippy-forked + --releaseUri https://maven.pkg.github.com/ucb-substrate/chippy \ + --snapshotUri https://maven.pkg.github.com/ucb-substrate/chippy