ci: run job in ghcr.io/gmeligio/flutter-android image #121
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/update_flutter_dependencies.yml | |
- config/flutter_version.json | |
workflow_dispatch: | |
# TODO: Remove pull_request. Only used for testing container.image | |
pull_request: | |
paths: | |
- .github/workflows/update_flutter_dependencies.yml | |
- config/flutter_version.json | |
jobs: | |
update_version: | |
permissions: | |
# Enable OIDC token because Gitsign creates keys based on the GitHub runner OIDC credentials | |
# id-token: write | |
contents: write | |
# Allow to read packages to pull the container image from GitHub Container Registry | |
packages: read | |
pull-requests: write | |
runs-on: ubuntu-22.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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # 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@1e60f620b9541d16bece96c5465dc8ee9832be0b # 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: Setup Gitsign to sign git commits | |
# uses: chainguard-dev/actions/setup-gitsign@9ba949ac63357c725a9438f3e05a1e33d313498e # main | |
- 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@4320041ed380b20e97d388d56a7fb4f9b8c20e79 # 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 }} |