flutter-action
flutter-action copied to clipboard
Problem with cache key passed to `@actions/cache`
In this line: https://github.com/subosito/flutter-action/blob/0c3f14223a08fa950c8a4c00bcfb834e65744135/action.yml#L38
The flutter-version
passed to the action is appended to the key passed to actions/cache
, which is okay, except for the fact that the version may be something like 3.x
, which creates some issues:
Say when the action was first run, Flutter 3.0.0 was installed and cached. Flutter 3.3.0 is released, and then the action is run again. Instead of using the newly-released Flutter 3.3.0, the action will use the cached Flutter 3.0.0 instead.
This problem can be fixed by appending the actual version of Flutter installed instead, or by invalidating the cache when a newer version is available.
@mhmdanas Hello! In that case, surely, an additional cache key should be given, at least in the current version. Something like this,
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@main
with:
flutter-version: 'any'
channel: 'stable'
cache: true
cache-key: '2022-06-07' ## Manually Update this `key`
- run: flutter --version
We now support dynamic cache-key
and cache-path
https://github.com/subosito/flutter-action/blob/main/action.yml#L23 to cover this issue. Please reopen if the issue persists.