Skip to content

Fix: Firebase tool installation failure #2068

Fix: Firebase tool installation failure

Fix: Firebase tool installation failure #2068

Workflow file for this run

name: build
on:
push:
branches:
- main
pull_request:
branches:
- main
# Declare default permissions as read only.
permissions: read-all
jobs:
test:
name: Analyze and test code examples
runs-on: ubuntu-latest
if: github.repository == 'cfug/flutter.cn'
strategy:
fail-fast: false
matrix:
include:
- name: "Beta channel"
branch: beta
experimental: false
- name: "Stable channel"
branch: stable
experimental: true
continue-on-error: ${{ matrix.experimental }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
with:
channel: ${{ matrix.branch }}
- name: Fetch Dart dependencies
run: dart pub get
continue-on-error: ${{ matrix.experimental }}
- name: Check Dart code formatting
run: dart run dash_site format-dart --check
continue-on-error: ${{ matrix.experimental }}
- name: Analyze Dart code
run: dart run dash_site analyze-dart
continue-on-error: ${{ matrix.experimental }}
- name: Run Dart tests
run: dart run dash_site test-dart
continue-on-error: ${{ matrix.experimental }}
excerpts:
name: Check if code excerpts are up to date
runs-on: ubuntu-latest
if: github.repository == 'cfug/flutter.cn'
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: beta
- name: Fetch Dart dependencies
run: dart pub get
- name: Check if excerpts are up to date
run: dart run dash_site refresh-excerpts --fail-on-update --dry-run
continue-on-error: ${{ matrix.experimental }}
linkcheck:
name: Build site and check links
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.repository == 'cfug/flutter.cn'
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: beta
- name: Fetch Dart dependencies
run: dart pub get
- name: Install firebase-tools
run: curl -sL https://firebase.tools/ | sed s/latest/v15.2.1/ | bash
- name: Build site
run: dart run dash_site build
- uses: actions/setup-node@v6
with:
node-version: 22
- name: Translated (docs.flutter.cn)
run: bash tool/translator/build.sh
shell: bash
- name: Check for broken Markdown link references
run: dart run dash_site check-link-references
- name: Check for broken internal links
run: dart run dash_site check-links
firebase-validate:
name: Validate Firebase configuration
runs-on: ubuntu-latest
if: github.repository == 'cfug/flutter.cn'
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: beta
- name: Fetch Dart dependencies
run: dart pub get
- name: Validate the firebase.json file
run: dart run dash_site verify-firebase-json
deploy:
name: Deploy to production
needs: [test, excerpts, linkcheck, firebase-validate]
runs-on: ubuntu-latest
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
github.repository == 'cfug/flutter.cn'
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
# docs.flutter.cn | https://github.com/cfug/flutter.cn/pull/1518
fetch-depth: 0
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: beta
- name: Fetch Dart dependencies
run: dart pub get
- name: Build site
run: dart run dash_site build --release
- uses: actions/setup-node@v6
with:
node-version: 22
- name: Translated (docs.flutter.cn)
run: bash tool/translator/build.sh
shell: bash
- name: Deploy to production
run: bash tool/translator/deploy-cn.sh
shell: bash
env:
DEPLOY_USER: ${{ secrets.DOCS_REPO_DEPLOY_USER }}
DEPLOY_TOKEN: ${{ secrets.DOCS_REPO_DEPLOY_TOKEN }}