flutter-action
flutter-action copied to clipboard
Remove yq dependency to fetch version from file
Hi
Theres a bash way to parse the file and is using grep and awk like: I use that on my scripts like:
- name: Prepare flutter version from pubspec.yml
run: |
$content = Get-Content -Path pubspec.yaml
$match = [regex]::match($content, 'flutter: (\d+\.\d+\.\d+)')
echo "FLUTTER_VERSION=$($match.Groups[1].Value)" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: pwsh
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{env.FLUTTER_VERSION}}
cache: false
Maybe the way that flutter-version-file
works could change to this to avoid the YQ dependency install on windows, WDYT? can you guide me on how to change that? I could create the PR with that change 🤓
- Clone the repository.
- Read the source code.
- Change it.
- Test it. ...
- Fix is released.
- PROFIT!
Why is there a downvote on this? It a legit request. Its a great plugin but fails on Windows due to the yq dependency.
This is my usage example https://github.com/alleey/flutter-guesstheword/actions/runs/9027817973/workflow
and reading version from pubspec works except for Windows. I had to figure it out the hard way after so many failed attempts. The solution, for now, is to hard code version for the Windows platform.
It would be really great if Windows' builds could read version from pubspec.
See https://github.com/actions/runner-images/issues/7443 - hopefully this will be reconsidered.