ckipp01 / mill-ci-release

A Mill plugin to help making publishing to Sonatype from GitHub Actions easier.
Apache License 2.0
14 stars 6 forks source link

publishAll task succeeds without publishing artifacts #109

Closed Iltotore closed 2 months ago

Iltotore commented 8 months ago

Version: 0.1.9 Action Logs: https://github.com/pidoveproject/scala-showdown-api/actions/runs/7398615577/job/20128141194 Workflow file: https://github.com/pidoveproject/scala-showdown-api/actions/runs/7398615577/workflow

When the publishAll task is executed, the following logs appear:

[info] compiling 1 Scala source to /home/runner/work/scala-showdown-api/scala-showdown-api/out/mill-build/compile.dest/classes ...
[info] done compiling
Attempting to setup gpg
gpg: directory '/home/runner/.gnupg' created
gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
gpg: /home/runner/.gnupg/trustdb.gpg: trustdb created
gpg: key 0C4AFF7B1B7DD1EE: public key "Fromentin <rafbodaha@gmail.com>" imported
gpg: key 0C4AFF7B1B7DD1EE: secret key imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg:       secret keys read: 1
gpg:   secret keys imported: 1

But the project is not published (not even compiled). This is the first time such issue is happening to me despite using the same workflow file and build.sc for other projects. See this one for example.

Running publishAll in local returns the same result. I don't know if it's a bug or a mistake on my side.

ckipp01 commented 8 months ago

🤔 looking at the logs I'm not really sure. It's odd that it doesn't even compile anything, like it doesn't pick up the modules that need to be published at all. One thing we could try to do is add extra logging right after here to log out the modules that it found and is expected to publish. Then we could see if it's actually picking up the modules you'd expect. It might not be, and then just skipping everything else.

Iltotore commented 8 months ago

Using this task:

def publishAll(ev: Evaluator) = T.command {
    val modules = ev.rootModule.millInternal.modules.collect { case m: CiReleaseModule => m }

    T.log.info(s"Modules: $modules")
}

I get the following:

Modules: List(docs, main, main.js, tyrian, zio)

which is the expected result.

nightscape commented 5 months ago

I ran into the same issue. I managed to set up IntelliJ to debug the plugin run and found out that internally there was a Result.Failure about no developer being defined. That error was lost along the way though. This code block where different Result.Failures are instantiated, but the result is just cast to Unit looks suspicious. @ckipp01 what is the intention here? Shouldn't the Result.Failure be propagated to the caller so that Mill can forward and show the error to the user?

Iltotore commented 4 months ago

I ran into the same issue. I managed to set up IntelliJ to debug the plugin run and found out that internally there was a Result.Failure about no developer being defined.

I'm not sure this (thought it is indeed a problem) is the bug actually causing this issue in my case. I defined the developers in my pomSettings. Did I miss something?

nightscape commented 4 months ago

It doesn't have to be the developers parameter. I'd recommend going through all the checks in the link above concerning the lost Result.Failure and check if any of them could be the issue.

ckipp01 commented 4 months ago

I ran into the same issue. I managed to set up IntelliJ to debug the plugin run and found out that internally there was a Result.Failure about no developer being defined. That error was lost along the way though. This code block where different Result.Failures are instantiated, but the result is just cast to Unit looks suspicious. @ckipp01 what is the intention here? Shouldn't the Result.Failure be propagated to the caller so that Mill can forward and show the error to the user?

To be honest, looking back, I'm not 100% sure why I did that. Feel free to try and adjust it and send in a PR.

nightscape commented 4 months ago

See https://github.com/ckipp01/mill-ci-release/pull/118

Iltotore commented 4 months ago

Finally had the time to work on this issue on my project and I confirm this was caused by an error on my side silenced by the problem fixed in #118. The artifacts did upload. Will update this message and eventually close this issue once the artifacts are available on Central and I checked they are ok.