Skip to content

Commit

Permalink
Fix publishing (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianReeves authored Oct 5, 2024
1 parent c18c8df commit 43fade6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 19 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ jobs:
group: ${{ github.workflow}}-publish-${{ github.sha }}

env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET_BASE64 }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MILL_PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
MILL_PGP_SECRET_BASE64: ${{ secrets.PGP_SECRET_BASE64 }}
MILL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MILL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
PUBLISH_AS_SNAPSHOT: true
LANG: "en_US.UTF-8"
LC_MESSAGES: "en_US.UTF-8"
Expand Down Expand Up @@ -321,7 +321,7 @@ jobs:
restore-keys: ${{ runner.os }}-mill-native-11-3.3.4-${{ github.sha }}-

- name: Publish artifacts to Sonatype
run: ./mill -i -j 0 io.kipp.mill.ci.release.ReleaseModule/publishAll
run: ./mill -i -j 0 mill.scalalib.PublishModule/

ci:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions build.mill.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import $ivy.`com.lihaoyi::mill-contrib-buildinfo:$MILL_VERSION`
import com.goyeau.mill.scalafix.ScalafixModule
import com.carlosedp.aliases._
import coursier.maven.MavenRepository
import io.kipp.mill.ci.release.CiReleaseModule
import io.github.davidgregory084.TpolecatModule
import millbuild._
import millbuild.{Versions => Vers}
Expand All @@ -15,7 +14,7 @@ import mill._, mill.scalalib._, mill.scalajslib._, mill.scalanativelib._, scalaf
import mill.scalalib.publish.PublishInfo
import mill.scalajslib.api.ModuleKind
import mill.contrib.buildinfo.BuildInfo

import de.tobiasroeser.mill.vcs.version.VcsVersion


object `package` extends RootModule {
Expand Down Expand Up @@ -166,9 +165,10 @@ object `package` extends RootModule {

trait MorphirScalafixModule extends ScalafixModule

trait MorphirPublishModule extends CiReleaseModule with JavaModule {
trait MorphirPublishModule extends PublishModule with JavaModule {
import mill.scalalib.publish._
def packageDescription: String = s"The $artifactName package"
override def publishVersion: T[String] = VcsVersion.vcsState().format()

def pomSettings = PomSettings(
description = packageDescription,
Expand Down
25 changes: 16 additions & 9 deletions ci/release-maven.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
#!/usr/bin/env bash

set -eux
set -eu

#echo $GPG_PRIVATE_KEY_B64 | base64 --decode > gpg_key
echo $GPG_SECRET > gpg_key
echo "$PGP_SECRET" | base64 --decode > gpg_key

gpg --import gpg_key
gpg --import --no-tty --batch --yes gpg_key

rm gpg_key

mill.scalalib.PublishModule/publishAll \
--sonatypeCreds lihaoyi:$SONATYPE_PASSWORD \
--gpgArgs --passphrase,$GPG_PASSWORD,--batch,--yes,-a,-b \
# Build all artifacts
./mill -i __.publishArtifacts

# Publish all artifacts
./mill -i \
mill.scalalib.PublishModule/publishAll \
--sonatypeCreds "$SONATYPE_USER":"$SONATYPE_PASSWORD" \
--gpgArgs --passphrase="$PGP_PASSWORD",--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \
--publishArtifacts __.publishArtifacts \
--readTimeout 600000 \
--readTimeout 3600000 \
--awaitTimeout 3600000 \
--release true \
--signed true
--signed true \
--sonatypeUri https://s01.oss.sonatype.org/service/local \
--sonatypeSnapshotUri https://s01.oss.sonatype.org/content/repositories/snapshots
3 changes: 1 addition & 2 deletions mill-build/build.mill.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ object `package` extends MillBuildRootModule {
ivy"dev.zio::zio-config-yaml:4.0.2",
ivy"dev.zio::zio-config-refined:4.0.2",
ivy"com.carlosedp::mill-aliases::0.4.1",
ivy"io.chris-kipp::mill-ci-release::0.1.10",
ivy"com.goyeau::mill-scalafix::0.3.1",
ivy"com.google.jimfs:jimfs:1.3.0",
ivy"io.github.davidgregory084::mill-tpolecat::0.3.5",
//ivy"org.yaml:snakeyaml:1.33",
ivy"de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0"
)

override def mapDependencies: Task[coursier.Dependency => coursier.Dependency] = T.task {
Expand Down

0 comments on commit 43fade6

Please sign in to comment.