Skip to content

Update curl to fetch latest versions #16

Update curl to fetch latest versions

Update curl to fetch latest versions #16

name: Verify Plugin Build

Check failure on line 1 in .github/workflows/plugin_build_verification.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/plugin_build_verification.yml

Invalid workflow file

(Line: 64, Col: 12): Job 'verify-plugin' depends on unknown job 'setup-matrix'.
on:
workflow_dispatch:
jobs:
fetch-versions:
runs-on: ubuntu-latest
outputs:
flutter_versions: ${{ steps.set-flutter.outputs.versions }}
kotlin_versions: ${{ steps.set-kotlin.outputs.versions }}
steps:
- name: Fetch Flutter Versions
id: set-flutter
run: |
VERSIONS=$(curl -s https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json | \
jq -c '
.releases
| reduce .[] as $r (
{seen: [], out: []};
if ($r.channel == "stable")
and ($r.version | test("^[v]?[0-9]+\\.[0-9]+\\.[0-9]+"))
then
($r.version | sub("^v"; "") | capture("(?<mm>[0-9]+\\.[0-9]+)")) as $v
| if (.seen | index($v.mm)) then .
else
.seen += [$v.mm]
| .out += [$r.version | sub("^v"; "")]
end
else .
end
)
| .out[0:5]
')
echo "Fetched Flutter Versions: $VERSIONS"
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
- name: Fetch Kotlin Versions
id: set-kotlin
run: |
VERSIONS=$(curl -s https://endoflife.date/api/v1/products/kotlin/ | \
jq -c '
.result.releases
| reduce .[] as $r (
{seen: [], out: []};
($r.latest.name | test("^[0-9]+\\.[0-9]+\\.[0-9]+")) as $ok
| if $ok then
($r.latest.name | capture("(?<mm>[0-9]+\\.[0-9]+)")) as $v
| if (.seen | index($v.mm)) then .
else
.seen += [$v.mm]
| .out += [$r.latest.name]
end
else .
end
)
| .out[0:5]
')
echo "Fetched Kotlin Versions: $VERSIONS"
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
verify-plugin:
needs: setup-matrix
runs-on: ubuntu-latest
strategy:
matrix:
flutter-version: ${{ fromJson(needs.setup-matrix.outputs.flutter_versions) }}
kotlin-version: ${{ fromJson(needs.setup-matrix.outputs.kotlin_versions) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
- name: Accept Android licenses
run: yes | flutter doctor --android-licenses
- name: Remove flutter_lints
working-directory: example
run: flutter pub remove flutter_lints || true
- name: Set Kotlin version in example (settings.gradle)
run: |
sed -i "s/id \"org.jetbrains.kotlin.android\" version \".*\"/id \"org.jetbrains.kotlin.android\" version \"${{ matrix.kotlin-version }}\"/" example/android/settings.gradle
- name: Get example dependencies
working-directory: example
run: flutter pub get
- name: Build example APK
working-directory: example
run: flutter build apk --debug --no-tree-shake-icons
env:
GRADLE_OPTS: "-Xmx4g"