-
Notifications
You must be signed in to change notification settings - Fork 123
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
👷 only run CI publish / --dry-run when a package's version changes #424
👷 only run CI publish / --dry-run when a package's version changes #424
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #424 +/- ##
===========================================
+ Coverage 89.18% 93.63% +4.44%
===========================================
Files 5 8 +3
Lines 333 440 +107
===========================================
+ Hits 297 412 +115
+ Misses 36 28 -8
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
That was a hard battle. :) |
Sadly one can only test by triggering the CI. PS #425 will need to be merged as well because it somehow slipped in there when I was copying the dry run workflow into the publish workflow. |
The idea here is to only run
dart pub publish
ordart pub publish --dry-run
when the package's version inpubspec.yaml
is higher than the base branch's.Example:
The base branch's version is obtained using a separate job that first checks out the base branch
and then parses its
pubspec.yaml
fileThat base version is then exported as an output
so that it can be consumed by another job that does the version comparison
It uses pub_semver to determine whether or not the version of the PR is higher than the version of the base branch. It's slower and more complex than just using
printf
or regex but then again it's also safer as it comes from the Dart team.Also using Github action matrices here for better readability.