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

Allow using Resolver/Publisher independently #44

Open
iRevive opened this issue Dec 14, 2021 · 1 comment
Open

Allow using Resolver/Publisher independently #44

iRevive opened this issue Dec 14, 2021 · 1 comment

Comments

@iRevive
Copy link

iRevive commented Dec 14, 2021

Currently, it's hard to use a plugin only for publishing. Especially when the publishing process happens only on CI. At this point, a valid token is not needed locally.

But the build will fail anyway since the credentials setting requires a token to be defined.

From my point of view, the functionality can be separated into smaller modules.

Project modules:

  • sbt-github-packages-common - shared modules: TokenSource, GitHubRepository, utility methods
  • sbt-github-packages-publisher - only Publisher
  • sbt-github-packages-resolver - only Resolver
  • sbt-github-packages - both Publisher and Resolver. Identical to the current definition.

Publisher

Responsible for the publishing part.

Settings:

  • githubSuppressPublicationWarning
  • githubPublishToRepository - The entry is a combination of owner, repository, and token source.
githubPublishToRepository := GitHubRepository(
  "djspiewak", 
  "sbt-github-packages", 
  TokenSource.Environment("GH_PACKAGES_TOKEN")
)

Derived settings (based on githubPublishToRepository):

  • githubPublishTo
  • scmInfo
  • homepage
  • pomIncludeRepository
  • publishMavenStyle

Behavior:

  • update - does not fail if a token is missing
  • publish - may fail if a token is missing

Resolver/Downloader/Loader

The should be a better name I believe.

It would be nice if multiple GitHub repositories can be supported.

Settings:

  • githubRepositories - The GitHub repositories. The entry is a combination of owner, repository, and token source.
githubRepositories += GitHubRepository(
  "djspiewak", 
  "sbt-github-packages", 
  TokenSource.Environment("GH_TOKEN")
)

Derived settings (based on githubRepositories):

  • resolvers
  • credentials

Behavior:

  • update - may fail if a token is missing
@colindean
Copy link

I just had to work around this problem with target/data-validator#98 by setting an invalid token just to allow sbt to run.

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

No branches or pull requests

2 participants