release 0.1.0 copy "release: ^0.1.0" to clipboard
release: ^0.1.0 copied to clipboard

A small utility that allows to easily update your pubspec and your Github tags on new releases.

📦 release utility #

Pub Likes Pub Popularity Pub Points MIT License

release utility is, as its name may suggest, a small command line utility that helps you quickly releasing your Darts apps.

It takes care of :

  • Reading the pubspec.yaml file to find the current version.
  • Finding the changes since the last release run.
  • Bumping the version and the version code, marking breaking changes.
  • Writing the changes in the CHANGELOG.md file.
  • Updating both pubspec.yaml and snap/snapcraft.yaml files.
  • Committing and pushing the changes.
  • Creating a Github release, or just a tag if the previous step has failed.
  • Publishing the pub.flutter-io.cn package, if no publish_to: none is specified in the pubspec.yaml file.

Also : almost everything is configurable.

Warning

Currently, release has only been tested on Windows. Feel free to test it on other platforms and to give your feedback !

Getting started #

Installation #

For most users, you only have to run the following commands :

dart pub add dev:release
dart pub get

Note

It can be added as a regular dependency by removing the dev: prefix. You'll be able to use the Release class in your code.

Usage #

It's simple as :

dart run release

The utility will guide you through the release process. Note that, in order to generate your CHANGELOG.md file, release needs your commits to be formatted according to conventional commits.

Configuration #

You can configure the release utility directly in your pubspec.yaml file. Here's an example :

name: my_app
description: my_app_description
version: 0.0.1
repository: https://github.com/me/my_app

# Other values, like dependencies and dev dependencies.

# See https://pub.flutter-io.cn/documentation/release/latest/release/ReleaseConfig-class.html for more details.
release:
  changelog:
    header: '# 📰 my_app changelog'
    defaultIgnoredScopes: [ 'docs', 'version', 'deps' ] # This is the default.
    # Entries are processed using Liquid template engine.
    entry:
      title: '## v{{ version }}' # This is the default.
      header: 'Released on {{ date | date: "MMMM d, yyyy" }}.' # This is the default.
      item: '* **{% if breaking %}BREAKING {% endif %}{{ type | upcase }}**: {{ description }} ({% if repo %}[#{{ hash }}](https://github.com/{{ repo }}/commit/{{ hash }}){% else %}#{{ hash }}{% endif %})' # This is the default.
    git:
      github: https://github.com/me/my_app # Alternative to top-level `repository`.
      newVersionCommitMessage: 'chore(version): Updated version and changelog.' # This is the default.
      remote: 'main' # This is the default.

Setup Github releases #

You have to go to https://github.com/settings/personal-access-tokens/new in order to create a new fine-grained token.

  • Token name : put your token name here.
  • Description : put anything you want here.
  • Expiration date : enter any expiration date you want.

In the Repository access section, tick Only select repositories and then choose your app repository.

Then, in the Permissions section, click on Add permissions, select Contents and then, adjust the accesses like this :

  • Contents : must be set to Read and write.
  • Metadata : must be set to Read only.

Here's a screenshot of my setup for the release utility :

Screenshot

Once done, click on Generate token. Then, all you have to do it to create a .env file, at the root of your project folder containing your Github token :

GITHUB_PAT=github_pat_...

Caution

This token should not be shared with anyone. In particular, the .env file should not be version controlled (ie. put it in .gitignore).

Example #

This utility is used in some of my apps and projects. Feel free to check their CHANGELOG.md, their pubspec.yaml, their releases page, etc.

License #

This project is licensed under the MIT License.

Contributions #

There are many ways you can contribute to this project :

0
likes
0
points
35
downloads

Publisher

verified publisherskyost.eu

Weekly Downloads

A small utility that allows to easily update your pubspec and your Github tags on new releases.

Repository (GitHub)
View/report issues

Funding

Consider supporting this project:

ko-fi.com
paypal.me

License

unknown (license)

Dependencies

args, conventional_commit, dotenv, http, intl, liquify, meta, pub_semver, yaml, yaml_edit

More

Packages that depend on release