When you create a new commit in Git, a new version of your code is created. With Widgetbook builds developers make the new version of their local Widgetbook accessible for the whole team. If set up with CI/CD, you can have a build for each commit, for each pull-request and for each branch.
Widgetbook Cloud builds have to be uploaded based on a Flutter web build. To create a Flutter web build, follow these steps:
- Locate your Widgetbook project
- Run the build runner by using
flutter pub run build_runner build -d
flutter build web -t widgetbook.dart
Publish a build#
To publish a build, follow these steps:
- Activate the CLI by running
pub global activate widgetbook_cli
widgetbook publish --api-key API-KEY
Feel free to customize the
publish command by reading into the CLI arguments.
Publishing builds with the CI/CD is recommended as the setup is less error prone and more autonomous. See CI/CD Setup for more information.
# Install dependencies flutter pub get # Optional: Run the build runner flutter pub run build_runner build --delete-conflicting-outputs # Build the Widgetbook flutter build web -t lib/ui_catalogs.widgetbook.dart # Install the CLI dart pub global activate widgetbook_cli # Run the CLI widgetbook publish --api-key API-KEY