LoginSignup
14
5

More than 1 year has passed since last update.

【Flutter】Github Actionsでバージョン管理システムのFlutterバージョンを使う

Posted at

はじめに

Flutterバージョンをあげたとき、Github Actionsのワークフローで使うFlutterバージョンも書き換えるのめんどくさいですよね?
今回はfvmとasdfのバージョンをGithub Actionsで使う方法を紹介します。

fvm

flutter-fvm-config-actionを使うと、fvm_config.jsonファイルからFlutterバージョンを取得してワークフローを書けます。

- uses: kuhnroyal/flutter-fvm-config-action@v1
- uses: subosito/flutter-action@v2
  with:
    flutter-version: ${{ env.FLUTTER_VERSION }}
    channel: ${{ env.FLUTTER_CHANNEL }}
    cache: true

asdf

import-asdf-tool-versions-actionを使うと、.tool-versionsファイルからFlutterバージョンを取得してワークフローを書けます。

- uses: wasabeef/import-asdf-tool-versions-action@v1.0.1
  id: asdf
- uses: subosito/flutter-action@v2
  with:
    channel: stable
    flutter-version: ${{ steps.asdf.outputs.flutter }}
    cache: true

まとめ

楽!

14
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
5