搜尋套件、儲存庫與 APP 分類

套件詳情v11.11.1

pub_release

自動將 Dart 套件發布到 pub.dev,包括執行 dartfmt、建立 git 標籤、遞增套件版本號並推送套件至 pub.dev。

macOSWindowsLinux
近 30 天下載
970
喜歡數
22
Pub 分數
150

安裝套件

flutter pub add pub_release

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

pub_release 是一個 Flutter/Dart 套件,可自動將 Dart 套件發佈至 pub.dev。它透過執行 dartfmt 進行程式碼格式化、遞增版本號、建立 git 標籤,並將更新後的套件推送至 pub.dev 來簡化發佈流程。此工具專為經常發佈套件的開發者設計,可減少手動步驟並降低發佈工作流程中的錯誤。支援 macOS、Windows 和 Linux,使其可在主要開發環境中使用。

適用情境

  • 自動化軟體包發佈
  • 簡化 pub.dev 發佈
  • 確保程式碼格式一致
  • 管理版本遞增
  • 減少手動發佈錯誤

主要特色

  • 自動執行 dartfmt
  • 版本升級
  • Git 標籤
  • 發布到 pub.dev
  • 跨平台支援

適合對象

  • Dart 套件維護者
  • CI/CD 流水線整合
  • 頻繁發布者
  • 開源貢獻者

使用建議

  • 需要 git 設定
  • 需要 pub.dev 憑證
  • 依賴於正確的版本控制策略
  • 可能需要為複雜的工作流程進行自定義設定

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

README

Pub Release is a package that automates publishing dart/flutter packages to pub.dev.

Pub Release also supports the simultaneous release of multiple related packages.

Pub Release performs the following operations:

  • Run pre/post release 'hook' scripts.
  • Formats all code using dartfmt
  • Increments the version no. using semantic versioning after asking what sort of changes have been made.
  • Creates a dart file containing the version no. in src/version/version.g.dart
  • Updates the pubspec.yaml with the new version no.
  • If you are using Git:
    • Generates a Git Tag using the new version no.
    • Generates release notes from commit messages since the last tag.
    • Publish any executables list in pubspec.yaml as assets on github
  • Allows you to edit the release notes.
  • Adds the release notes to CHANGELOG.MD along with the new version no.
  • Publishes the package to pub.dev.

Getting Started

Install Pub Release globally:

dart pub global activate pub_release

Run it from your package root:

pub_release

Read the full documentation to learn how to use it.

Common Workflows

Dry-run a release (no publish):

pub_release --dry-run

Set a specific version and skip prompts:

pub_release --setVersion=1.2.3 --autoAnswer

Run multi-package release in a mono-repo:

pub_release multi

Dry Run

Use --dry-run to validate a release without publishing. During a dry run, pub_release performs the publish step inside a temporary copy of your package to avoid git working tree warnings while still validating the generated version and changelog.

If you need to allow warnings from dart pub publish, pass --ignore-warnings.

Commands

  • pub_release - release a single package (default).
  • pub_release multi - release related packages using tool/pubrelease.multi.yaml.
  • pub_release help - show usage.

Flags

  • --dry-run - validate but do not publish.
  • --ignore-warnings - pass --ignore-warnings to dart pub publish.
  • --[no]-test - enable/disable unit tests (default: on).
  • --test-concurrency=<n> - maximum concurrent test suites (positive integer); overrides the project setting.
  • --line=<n> - formatter line length (default: 80).
  • --[no]-format - enable/disable formatting (default: on).
  • --verbose - enable verbose logging.
  • --git - enable git operations (default: on).
  • --no-multi - disable multi-release even if a multi config exists.
  • --askVersion - prompt for version (default).
  • --setVersion=<x.y.z> - set version directly.
  • --autoAnswer - suppress prompts (requires --setVersion).
  • --tags=<tag,...> - only run tests matching tags.
  • --exclude-tags=<tag,...> - exclude tests by tag.
  • --skip-packages=<name,...> - skip named packages when running the multi command.

Test Concurrency

For projects whose tests share external state, run test suites serially by adding the following to tool/.pubrelease.yaml:

test-concurrency: 1

Override the project setting for a release with:

pub_release --test-concurrency=4

Pub Release passes the selected value to critical_test as --concurrency=<n>. The value must be a positive integer. If neither setting is provided, critical_test's default concurrency is unchanged. For multi-package releases, the selected value applies to every released package. --no-test still skips tests regardless of the concurrency setting.

Multi Release Notes

When using pub_release multi, the first package that generates a changelog entry will have its release notes propagated to the other packages unless they already contain notes for that version.

所屬分類

依賴

依賴清單 10 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。