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

feat: Add GitHub Workflow for Publishing to pub.dev #355

Merged
merged 3 commits into from
Jan 20, 2025

Conversation

oriventi
Copy link
Contributor

@oriventi oriventi commented Jan 6, 2025

Summary

This PR introduces a GitHub Actions workflow that automates publishing to pub.dev whenever a new release or tag is created. The feature is implemented through a new file added to the .github/workflows directory.

Workflow Details

  • Workflow Name: Publish to pub.dev
  • Trigger: The workflow is triggered on a push event with tags that follow the semantic versioning pattern (v[0-9]+.[0-9]+.[0-9]+*), such as v1.2.3.
  • Implementation: The workflow uses the dart-lang/setup-dart/.github/workflows/publish.yml@v1 reusable workflow from the official documentation.

Benefits

  • Collaborators-Friendly: This workflow allows collaborators to publish to pub.dev simply by creating a new release or tag, streamlining the release process.
  • Owner’s Setup: To enable this automation, the project owner needs to enable automated publishing on pub.dev for this package. (A screenshot demonstrating how to enable this setting is attached below.)

Steps for Owners to Enable Automated Publishing

To enable this workflow, the package owner must:

  1. Go to the pub.dev package admins section.
  2. Enable "Automated Publishing" by following the provided screenshot.

Screenshot 2025-01-06 182340

@aagarwal1012
Copy link
Owner

@oriventi, I have updated the config on my side as per the details mentioned.
cc: @queendevelopers

@queendevelopers
Copy link
Collaborator

Hi @oriventi, just checking in—do we still need this PR, or can it be closed?

@oriventi
Copy link
Contributor Author

Hey @queendevelopers,
Yeah, this PR would be super helpful! Right now only @aagarwal1012 is able to publish new versions to pub.dev.
This adds a GitHub workflow that lets collaborators like you publish too - just update the version in pubspec.yaml and changelog.md, tag a commit with vX.X.X, and it'll automatically push to pub.dev. Since you're active here, it makes sense for you to be able to publish updates too. What do you think?

@queendevelopers
Copy link
Collaborator

Hey @queendevelopers, Yeah, this PR would be super helpful! Right now only @aagarwal1012 is able to publish new versions to pub.dev. This adds a GitHub workflow that lets collaborators like you publish too - just update the version in pubspec.yaml and changelog.md, tag a commit with vX.X.X, and it'll automatically push to pub.dev. Since you're active here, it makes sense for you to be able to publish updates too. What do you think?

Sound good! Actually, having this feature is a great way to keep package up-to-date with repository. Thank You!

Copy link
Collaborator

@queendevelopers queendevelopers left a comment

Choose a reason for hiding this comment

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

Looks great! Approved. Thanks!

@aagarwal1012
Copy link
Owner

@queendevelopers, I don't think there is the need to add id-token -- if not can you point me on how to generate the id token?

@queendevelopers
Copy link
Collaborator

queendevelopers commented Jan 20, 2025

@queendevelopers, I don't think there is the need to add id-token -- if not can you point me on how to generate the id token?

Apologies, my mistake. I believe everything should be good now. Thank you for reviewing!

@queendevelopers queendevelopers merged commit ee52225 into aagarwal1012:master Jan 20, 2025
2 of 3 checks passed
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.

3 participants