Skip to content

adil192/setup-flutter-submodule

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup Flutter submodule

This action installs and configures Flutter from a git submodule.

It largely does the same as other Flutter setup actions, but it uses a git submodule to get Flutter instead of downloading the latest SDK archive from Google.
This ensures your CI builds always use exactly the same Flutter version as your submodule, helping to make your builds more reproducible.

Usage

Create the submodule

In your project, add Flutter as a git submodule. The following command adds Flutter to a submodules/flutter directory and checks out the stable branch.

git submodule add -b stable https://github.com/flutter/flutter.git submodules/flutter

Use the action

Then, in your GitHub Actions workflow, use the action like this:

steps:
  - name: Checkout repository
    uses: actions/checkout@v4

  - name: Setup Flutter submodule
    uses: adil192/setup-flutter-submodule@v1
    with:
      flutter-path: submodules/flutter

  - name: Build for Android (or whatever you want to do with Flutter)
    run: flutter build apk

Options

  - name: Setup Flutter submodule
    uses: adil192/setup-flutter-submodule@v1
    with:
      # The path to the Flutter submodule (absolute or relative).
      flutter-path: submodules/flutter

      # (Optional)
      # The path to the pub cache directory (absolute or relative).
      # Defaults to .pub-cache in the current working directory.
      pub-cache: .pub-cache

      # (Optional)
      # Whether to cache the Flutter SDK between workflow runs.
      # Defaults to true.
      cache-flutter: true

      # (Optional)
      # Whether to cache the pub cache between workflow runs.
      # Defaults to true.
      cache-pub: true

Updating Flutter

Git submodules do not automatically update. When a new stable Flutter version is released, you need to manually update the submodule in your repository with the following command:

# Update the submodule from the remote repository
git submodule update -f --remote submodules/flutter
# Then commit the change
git commit -m "chore: update flutter submodule"

Flutter recommends that you subscribe to the flutter-announce group to be notified of new Flutter releases. [source]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •