Skip to content

chore(deps): update dependency ubuntu to v24 (#257) #133

chore(deps): update dependency ubuntu to v24 (#257)

chore(deps): update dependency ubuntu to v24 (#257) #133

on:
push:
branches:
- main
paths:
- .github/workflows/update_flutter_dependencies.yml
- config/flutter_version.json
workflow_dispatch:
# Declare default permissions as read only.
permissions:
contents: read
jobs:
update_version:
permissions:
# Allow to write contents to push commits
contents: write
# Allow to read packages to pull the container image from GitHub Container Registry
packages: read
# Allow to write pull requests to create a pull request
pull-requests: write
runs-on: ubuntu-24.04
container:
image: ghcr.io/${{ github.repository_owner }}/flutter-android:${{ vars.FLUTTER_VERSION }}
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Generate authentication token with GitHub App
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1
id: generate-token
with:
app-id: ${{ secrets.VERIFIED_COMMIT_ID }}
private-key: ${{ secrets.VERIFIED_COMMIT_KEY }}
- name: Copy Flutter version into version manifest and export FLUTTER_* environment variables
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
script: |
const script = require('./script/copyFlutterVersion.js')
await script({core})
- name: Update latest Fastlane version
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
script: |
const script = require('./script/updateFastlaneVersion.js')
await script({core, fetch})
- name: Setup Flutter
run: |
cd $FLUTTER_ROOT
git fetch origin ${{ env.FLUTTER_VERSION }}:${{ env.FLUTTER_VERSION }}
git switch ${{ env.FLUTTER_VERSION }}
# TODO: Create test app in specific folder with step id, to allow parallel execution
- name: Create test application
run: |
flutter create test_app
# TODO: Cache gradle https://github.com/gradle/gradle-build-action
- name: Update default Android platform versions in Flutter
working-directory: test_app/android
run: |
cat ../../script/updateAndroidVersions.gradle >> app/build.gradle
./gradlew --warning-mode all updateAndroidVersions
- name: Clean test application
run: |
rm -rf test_app
- name: Setup Cue for JSON validation
uses: cue-lang/setup-cue@a93fa358375740cd8b0078f76355512b9208acb1 # v1.0.1
- name: Validate version.json
run: cue vet config/version.cue config/version.json
- name: Setup NodeJS
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
cache: 'npm'
cache-dependency-path: docs/src/package-lock.json
node-version-file: docs/src/package.json
- name: Update documentation
working-directory: docs/src
run: |
npm ci --prefer-offline
npm run build
- name: Create commit message variable
run: |
echo "COMMIT_MESSAGE=chore: update flutter dependencies in version.json for ${{ env.FLUTTER_VERSION }}" >> $GITHUB_ENV
- name: Create pull request if there are changes
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
with:
commit-message: ${{ env.COMMIT_MESSAGE }}
branch: update-flutter-dependencies/${{ env.FLUTTER_VERSION }}
sign-commits: true
title: ${{ env.COMMIT_MESSAGE }}
token: ${{ steps.generate-token.outputs.token }}