Skip to content

pub.dev

Pushes a new Dart or Flutter package to pub.dev.

Setup

Because there is no automated way to obtain tokens, you must perform a valid release manually first for each package. This generates credentials at:

  • macOS: $HOME/Library/Application Support/dart/pub-credentials.json
  • Linux: $HOME/.config/dart/pub-credentials.json
  • Or: $HOME/.pub-cache/credentials.json

Configuration

OptionDescription
dartCliPathPath to Dart CLI. Default: dart
packagesList of package directories (for monorepos)
skipValidationSkip analyzer and dependency checks

Environment Variables

NameDescription
PUBDEV_ACCESS_TOKENValue of accessToken from credentials file
PUBDEV_REFRESH_TOKENValue of refreshToken from credentials file

Examples

Single Package

targets:
- name: pub-dev

Multiple Packages (Monorepo)

targets:
- name: pub-dev
packages:
uno:
dos:
tres:

Skip Validation

Use cautiously—this skips analyzer checks:

targets:
- name: pub-dev
skipValidation: true