djspiewak / sbt-spiewak

A plugin which represents my personal SBT project baseline
Apache License 2.0
53 stars 20 forks source link

Fix `release` command for snapshots #52

Closed armanbilge closed 3 years ago

armanbilge commented 3 years ago

This PR creates a sonatypeBundleReleaseIfRelevant task which skips the sonatypeBundleRelease task when releasing a snapshot. This is because snapshots are uploaded directly by the publishIfRelevant task and the bundling step is unnecessary (and will fail).

SBT still bewilders me so apologies for any blunders or bad code style ...

djspiewak commented 3 years ago

Ahhhh! Nice catch. I didn't even realize this was an issue.

armanbilge commented 3 years ago

It was easy to miss, because with the plugin's defaults I think it's impossible to publish a snapshot via GitHub actions (publishing snapshots locally is possible, but presumably nobody has tried to push these to sonatype).

I think the build failure is related to https://github.com/sbt/sbt/pull/6363 which is fixed in the latest SBT. So after merging in main, CI should hopefully pass now.

djspiewak commented 3 years ago

@armanbilge I had to revert this because sonatypeBundleRelease is actually a command rather than a task, so it can't be called in this fashion. I didn't notice it until attempting to release sbt-spiewak itself. I'm actually not 100% certain how to encode a dynamic task as a command. I'm sure it's possible, I just don't know exactly how.

armanbilge commented 3 years ago

Shoot, sorry about that. I've been using this in https://github.com/armanbilge/schrodinger/ without problem?

Edit: nope, maybe not actually, never released with it enabled, just snapshots. Sorry again.

djspiewak commented 3 years ago

No worries! It should still be possible to do this, just has to be encoded as a command, which is about 100x weirder than a task.