grind_publish 0.0.2 grind_publish: ^0.0.2 copied to clipboard
A library to automatically publish a package when its version increases.
grind_publish #
This package automatically publishes your library when the pubspec.yaml
version has been increased and merged into master.
Usage #
1. Setup the grind task like this: #
@Task('Automatically publishes this package if the pubspec version increases')
autoPublish() async {
final credentials = Credentials.fromEnvironment();
grind_publish.autoPublish('your-package-name', credentials);
}
2. Set the environmental variables in your CI runner #
By default the env vars are named: ACCESS_TOKEN
, REFRESH_TOKEN
, EXPIRATION
,
TOKEN_ENDPOINT
(optional), SCOPES
(optional).
You find the values on your local machine in ~/.pub-cache/credentials.json
after you once ran pub publish
.
3. Run the script in your CI pipeline #
This really depends on where you are running this. For GitLab example, simply look
at this .gitlab-ci.yml
.