introduce

Flutter Distributor is a complete tool for packaging and distributing your Flutter applications. With some simple configuration, your project can be quickly packaged and saved to a designated directory and published to a designated distribution platform.

Development of this tool cause is due to my personal work than translation after release, it needs to be packaged as Linux, macOS and Windows platform-specific packet format and posted to GitHub Releases, initially wrote a packaging script, but behind the need to support There are more and more formats, and each release takes a lot of time. Therefore, it has slowly evolved from the initial script to Flutter Distributor. It has been nearly two and a half months since the first line of code. Today, I can finally introduce it to everyone. I hope this tool can help everyone.

characteristic

  • The application is packaged in the format of a specific platform (supporting the desktop at the same time) and placed in the designated folder.
  • Support application package files named according to the specified format
  • Publish the application package to the designated distribution platform (currently only supports apk and ipa formats)

Supported package format

The above apk, aab, and ipa are in mobile software package format, and the others are in desktop software package format.

Supported distribution platforms

Quick start

Install

dart pub global activate flutter_distributor

usage

Add distribute_options.yaml to your project root directory, you can also view this complete example hello_world .

output: dist/

Configure a publisher

Take pgyer as an example. After logging in, click on the user avatar on the right, enter the API information page from the menu, copy API Key and add it to the env node.

https://www.pgyer.com/account/api

env:
  PGYER_API_KEY: 'your api key'

View all publisher documents and how to configure them.

Configure release items

The following example shows how to add a apk and ipa and publish to pgyer.com . A published item can contain multiple jobs.

build_args is flutter build command, please modify it according to your project.
releases:
  - name: dev
    jobs:
      - name: release-dev-android
        package:
          platform: android
          target: apk
          build_args:
            target: lib/main.dart
            flavor: dev
            target-platform: android-arm,android-arm64
        # 当你不需要发布到分发平台,请删除 publish_to 字段
        publish_to: pgyer
      - name: release-dev-ios
        package:
          platform: ios
          target: ipa
          build_args:
            target: lib/main.dart
            flavor: dev
            export-options-plist: ios/dev_ExportOptions.plist
        publish_to: pgyer

Complete example configuration

env:
  PGYER_API_KEY: 'your api key'
output: dist/
releases:
  - name: dev
    jobs:
      - name: release-dev-android
        package:
          platform: android
          target: apk
          build_args:
            target: lib/main.dart
            flavor: dev
            target-platform: android-arm,android-arm64
        publish_to: pgyer
      - name: release-dev-ios
        package:
          platform: ios
          target: ipa
          build_args:
            target: lib/main.dart
            flavor: dev
            export-options-plist: ios/dev_ExportOptions.plist
        publish_to: pgyer

Publish your app

flutter_distributor release --name dev

Related Links

thanks

🎉 🎉 🎉


lijy91
535 声望14 粉丝