Skip to content
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

A way to backpublish tags in CI? #66

Closed
armanbilge opened this issue Jan 10, 2022 · 5 comments
Closed

A way to backpublish tags in CI? #66

armanbilge opened this issue Jan 10, 2022 · 5 comments

Comments

@armanbilge
Copy link
Member

Noticed this in typelevel/kind-projector#196.

Possibly too esoteric, and kind projector use-case will slowly sunset anyway.

@rossabaker
Copy link
Member

Arguably the same commit could have just been tagged v0.13.2_2.13.8. If the automated versioning stripped underscores, it would have worked.

I don't think any of it is worth the effort.

@rossabaker
Copy link
Member

I'm satisfied with typelevel/kind-projector#205. We generally want to keep publishing from an existing tag, so changing the build doesn't help, and that shell script gives enough rigor to not mess it up.

@armanbilge
Copy link
Member Author

Here's one approach to this: typelevel/kind-projector#206

We could get sbt-typelevel to (optionally) spit out a workflow like this.

@armanbilge
Copy link
Member Author

Not enough need for this.

@armanbilge armanbilge closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2022
@kubukoz
Copy link
Member

kubukoz commented Sep 17, 2022

For anyone looking for something like this, I'm currently using the following:

// /project/backpublish.scala

object BackpublishPlugin extends AutoPlugin {

  override def projectSettings: Seq[Def.Setting[_]] =
    Option(System.getenv("BACKPUBLISH_VERSION")).toList.flatMap { backpublishVersion =>
      val projectVersion = Option(System.getenv("PROJECT_VERSION"))
        .getOrElse(sys.error("No PROJECT_VERSION provided"))

      println(
        s"Going to backpublish artifacts for Scala version $backpublishVersion, project version $projectVersion"
      )

      Seq(
        ThisBuild / version := projectVersion,
        ThisBuild / scalaVersion := backpublishVersion,
        ThisBuild / isSnapshot := false,
        ThisBuild / crossScalaVersions := Seq(backpublishVersion)
      )
    }

}

It's a bit hacky and you have to specify the version of the project that you want to backpublish, but it works.

source: https://github.com/polyvariant/better-tostring/tree/39659f635844446aee9799f6816513225e7b3428

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants