Skip to content

Commit

Permalink
update so publish can be called from CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisjkl committed Aug 2, 2024
1 parent a44a50a commit 6b75c84
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Publish ${{ github.ref }}
if: startsWith(github.ref, 'refs/tags/v') ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.publishSnapshot == 'true')
run: ./mill -i io.kipp.mill.ci.release.ReleaseModule/publishAll
run: ./mill -i InternalReleaseModule.publishAll
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand Down
20 changes: 19 additions & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import $ivy.`io.github.davidgregory084::mill-tpolecat::0.3.5`
import $ivy.`com.lewisjkl::header-mill-plugin::0.0.3`
import header._
import $file.plugins.ci.CiReleaseModules
import CiReleaseModules.{CiReleaseModule, SonatypeHost}
import CiReleaseModules.{CiReleaseModule, SonatypeHost, ReleaseModule, Discover}
import io.github.davidgregory084.TpolecatModule
import $ivy.`com.github.lolgab::mill-mima::0.1.1`
import com.github.lolgab.mill.mima._
Expand All @@ -14,6 +14,24 @@ import mill._
import mill.modules.Jvm
import mill.scalalib._
import mill.scalalib.publish._
import mill.define.ExternalModule
import mill.eval.Evaluator

object InternalReleaseModule extends Module {

/** This is a replacement for the mill.scalalib.PublishModule/publishAll task
* that should basically work identically _but_ without requiring the user to
* pass in anything. It also sets up your gpg stuff and grabs the necessary
* env variables to publish to sonatype for you.
*/
def publishAll(ev: Evaluator): Command[Unit] = {
ReleaseModule.publishAll(ev)
}

import Discover._
lazy val millDiscover: mill.define.Discover[this.type] =
mill.define.Discover[this.type]
}

trait BaseModule extends Module with HeaderModule {
def millSourcePath: os.Path = {
Expand Down
2 changes: 1 addition & 1 deletion plugins/ci/CiReleaseModules.sc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ trait CiReleaseModule extends PublishModule {

// In here for the Discover import
@nowarn("msg=Unused import")
object ReleaseModule extends ExternalModule {
object ReleaseModule extends Module {

/** This is a replacement for the mill.scalalib.PublishModule/publishAll task
* that should basically work identically _but_ without requiring the user to
Expand Down

0 comments on commit 6b75c84

Please sign in to comment.