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

How to: automatic publishing with multiple packages #67

Closed
guidezpl opened this issue Feb 1, 2023 · 5 comments
Closed

How to: automatic publishing with multiple packages #67

guidezpl opened this issue Feb 1, 2023 · 5 comments
Labels
type-documentation A request to add or improve documentation type-question A question about expected behavior or functionality

Comments

@guidezpl
Copy link

guidezpl commented Feb 1, 2023

https://dart.dev/tools/pub/automated-publishing mentions "multiple packages" a couple of times. But it doesn't show how to specify working-directory to support this.

Is this possible or do I have to create a separate workflow for each package?

cc @devoncarew

@devoncarew
Copy link
Member

There's an example of using automated publishing and mono-repos here:

https://github.com/google/dart-neats/blob/master/.github/workflows/publish.yml

It's a creative combo of bash and sed.

Separately, the dart team has some prescriptive tooling built on top of the pub + github automation; https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose. That's not really intended for broad use but is something we ourselves will use to publish packages. It'll detect whether it's running from a single package repo or a mono-repo; you can see an example of the integration here: https://github.com/dart-lang/shelf/blob/master/.github/workflows/publish.yaml.

@devoncarew devoncarew added type-question A question about expected behavior or functionality type-documentation A request to add or improve documentation labels Feb 2, 2023
@guidezpl
Copy link
Author

guidezpl commented Feb 2, 2023

Oh nice! It would be worth pointing this out in the docs

@devoncarew
Copy link
Member

cc @jonasfj @isoos wrt additional documentation / guidene around mono-repos?

@jonasfj
Copy link
Member

jonasfj commented Feb 3, 2023

Dumped a comment in dart-lang/site-www#4574

I think it's fairly reasonable to make a workflow file per package. The thing I did in dart-neats repo is only going to work in cases where the package folder is the package name, and the tag pattern is <package>-{{version}}.

I'm open to providing better logic, but honestly, it's probably better if we just tweak mono_repo to generate workflows for publishing.

@jonasfj jonasfj closed this as completed Feb 3, 2023
@jonasfj
Copy link
Member

jonasfj commented Feb 3, 2023

Filed google/mono_repo.dart#434

parlough added a commit to dart-lang/site-www that referenced this issue Feb 25, 2023
Context: dart-lang/setup-dart#67

I think the simplest advice is to create a workflow for each package.
But really, it's up to package authors what they want to do.

I did a fairly complex setup in:
https://github.com/google/dart-neats/blob/master/.github/workflows/publish.yml
This does avoid multiple files, but it's not something I'd suggest we
write a guide about how to replicate. If users want that then perhaps
they have to do it themselves :D

---------

Co-authored-by: Anthony Sansone <[email protected]>
Co-authored-by: Parker Lougheed <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-documentation A request to add or improve documentation type-question A question about expected behavior or functionality
Projects
None yet
Development

No branches or pull requests

3 participants