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

Add auto publish action #73 #78

Merged
merged 3 commits into from
Dec 8, 2024
Merged

Conversation

ManindraDeMel
Copy link
Collaborator

@ManindraDeMel ManindraDeMel commented Dec 3, 2024

GitHub Actions Workflows #73

These workflows automatically update your package's phone number metadata and publish to pub.dev.

Metadata Update Workflow (metadata-update.yml)

This workflow runs on the 1st of each month and:

  • Downloads new phone number metadata from Google's libphonenumber
  • Updates package files with new data
  • Increases package version number
  • Creates a git tag with new version (e.g. 'v1.2.3')
  • Pushes changes to GitHub

Publish Workflow (publish.yml)

This workflow automatically triggers when a version tag is pushed and:

  • Starts when metadata workflow creates a new version tag
  • Uses Dart's official process to publish to pub.dev
  • Uses secure OIDC authentication - no manual tokens needed

Setup Required (for owner)

  1. Add both workflow files to .github/workflows/
  2. Enable GitHub Actions permissions:
  • Go to repository Settings → Actions → General
  • Enable "Read and write permissions"
  • Enable "Allow GitHub Actions to create and approve pull requests"
  1. Verify pub.dev publisher status:
  • Login to pub.dev
  • Verify publishing rights for package
  • Ensure Google Account is verified

The workflows will then automatically update and publish the package monthly.

@cedvdb
Copy link
Owner

cedvdb commented Dec 3, 2024

Thanks for the concise doc ! I added a small comment

@ManindraDeMel ManindraDeMel requested a review from cedvdb December 5, 2024 01:41
@cedvdb
Copy link
Owner

cedvdb commented Dec 5, 2024

LGTM Thank you @ManindraDeMel I will try it out later this evening

@ManindraDeMel

This comment has been minimized.

@ManindraDeMel ManindraDeMel merged commit bb5c76e into cedvdb:main Dec 8, 2024
1 check passed
@cedvdb
Copy link
Owner

cedvdb commented Dec 8, 2024

I ran the update metadata workflow, but there is the following issues:

  • the update metadata makes an update and patches the pubspec version regardless if there is any change or not. It has created a 9.0.4 tag on github while there was no change for instance. (I removed it)
  • the publish action did not run at all for some reason.
  • there currently is no entry added to changelog.md

A command to get the number of modified files git status -s -uno | wc -l ( to be run before dart pub bump patch but after file generation). I'm investigating why publish hasn't run at all

@cedvdb
Copy link
Owner

cedvdb commented Feb 7, 2025

@ManindraDeMel I had created this issue with flutter tools in the past which is relevant to this:

dart-lang/pub#4461

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.

2 participants