Skip to content

Fix #12046: skip publishing nightly build when no new commits since last publish #12074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2021

Conversation

griggt
Copy link
Contributor

@griggt griggt commented Apr 13, 2021

Attempting to publish an already published version using sbt-sonatype
fails with a "Failed to promote the repository" error.

There don't appear to be any configuration settings in sbt-sontaype
for avoiding this, so instead we ask for published versions from the
Maven Central metadata and skip the publish step if we find a match.

Fixes #12046

@griggt
Copy link
Contributor Author

griggt commented Apr 13, 2021

I did some testing of this proposal over here.

@griggt griggt marked this pull request as ready for review April 13, 2021 03:59
@griggt griggt requested a review from smarter April 13, 2021 03:59

set -eu

major=${ver%%-bin-*}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once #11952 is merged, the binary version will be fixed to 3, so this won't work anymore, I suggest waiting until that PR is merged then just using _3.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/ is up, so you should be able to change the script to cut the version number after the first . or hardcode 3.

@smarter smarter assigned griggt and unassigned smarter Apr 15, 2021
Attempting to publish an already published version using `sbt-sonatype`
fails with a "Failed to promote the repository" error.

There don't appear to be any configuration settings in `sbt-sontaype`
for avoiding this, instead we perform a HEAD request to Maven Central
for the relevant POM file and check the result.
@griggt
Copy link
Contributor Author

griggt commented Apr 16, 2021

I opted to use the version number up to the first dot as the binary version, in the hope that it may be less brittle, and renamed the var so as to be more likely to be found by grep -i. That said, the workflow is structured such that publication is only skipped when the script is successful, so even if it doesn't get updated when it should, it won't suddenly halt publishing nightlies.

I also changed the script to just do a HEAD request for the POM file rather than retrieve the maven-metadata.xml and iterate over the versions for a match. The latter approach is ok when there are a small number of published versions for each binary version but now that the binary version is stable the version list will just keep growing...

@griggt griggt assigned smarter and unassigned griggt Apr 16, 2021
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smarter smarter merged commit 090b1b1 into scala:master Apr 16, 2021
@griggt griggt deleted the fix-#12046 branch April 16, 2021 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nightly Dotty workflow of 2021-04-11 failed
2 participants