Skip to content

Commit d80fe7f

Browse files
authored
[sync] 2026/06/03 (#1620)
2 parents ce80604 + 2724d14 commit d80fe7f

174 files changed

Lines changed: 596 additions & 295 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
# Initializes the CodeQL tools for scanning.
3535
- name: Initialize CodeQL
36-
uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba
36+
uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa
3737
with:
3838
languages: ${{ matrix.language }}
3939
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -44,7 +44,7 @@ jobs:
4444
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
4545
# If this step fails, then you should remove it and run the build manually (see below)
4646
- name: Autobuild
47-
uses: github/codeql-action/autobuild@9e0d7b8d25671d64c341c19c0152d693099fb5ba
47+
uses: github/codeql-action/autobuild@7211b7c8077ea37d8641b6271f6a365a22a5fbfa
4848

4949
# ℹ️ Command-line programs to run using the OS shell.
5050
# 📚 https://git.io/JvXDl
@@ -58,4 +58,4 @@ jobs:
5858
# make release
5959

6060
- name: Perform CodeQL Analysis
61-
uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba
61+
uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa

.github/workflows/compile_host_redirect_js.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ env:
1818

1919
jobs:
2020
compile_host_redirect_js:
21-
if: ${{ github.actor.login != 'cfug-dev' &&
22-
github.repository == 'cfug/flutter.cn' }}
21+
if: |
22+
github.actor.login != 'cfug-dev' &&
23+
github.repository == 'cfug/flutter.cn'
2324
runs-on: ubuntu-latest
2425
steps:
2526
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
26-
- uses: actions/setup-node@670825a89dc0abd596e7a3abd0f5e3f6e5faf37c
27+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
2728
with:
2829
node-version: ${{ env.NODE_VERSION }}
2930
- name: Build JS

.github/workflows/dart.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Dart code
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**/*.dart'
9+
- '**/pubspec.yaml'
10+
- '**/pubspec.lock'
11+
- '**/analysis_options.yaml'
12+
- 'examples/**'
13+
- 'packages/**'
14+
- 'tool/dash_site/**'
15+
- '.github/workflows/dart.yml'
16+
pull_request:
17+
branches:
18+
- main
19+
paths:
20+
- '**/*.dart'
21+
- '**/pubspec.yaml'
22+
- '**/pubspec.lock'
23+
- '**/analysis_options.yaml'
24+
- 'examples/**'
25+
- 'packages/**'
26+
- 'tool/dash_site/**'
27+
- '.github/workflows/dart.yml'
28+
# schedule:
29+
# - cron: '0 0 * * 0'
30+
31+
permissions: read-all
32+
33+
concurrency:
34+
group: ${{ github.workflow }}-${{ github.ref }}
35+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
36+
37+
jobs:
38+
test:
39+
name: Analyze and test Dart (${{ matrix.name }})
40+
runs-on: ubuntu-latest
41+
if: github.repository == 'cfug/flutter.cn'
42+
timeout-minutes: 30
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
include:
47+
- name: "Beta channel"
48+
branch: beta
49+
experimental: false
50+
- name: "Stable channel"
51+
branch: stable
52+
experimental: true
53+
continue-on-error: ${{ matrix.experimental }}
54+
steps:
55+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
56+
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
57+
with:
58+
channel: ${{ matrix.branch }}
59+
- name: Fetch Dart dependencies
60+
run: dart pub get
61+
continue-on-error: ${{ matrix.experimental }}
62+
# Disabled for now due to non-language versioned formatting changes.
63+
# TODO(parlough): Revisit this once standardized on 3.13 beta or newer.
64+
# - name: Check Dart code formatting
65+
# run: dart run dash_site format-dart --check
66+
# continue-on-error: ${{ matrix.experimental }}
67+
- name: Analyze Dart code
68+
run: dart run dash_site analyze-dart
69+
continue-on-error: ${{ matrix.experimental }}
70+
- name: Run Dart tests
71+
run: dart run dash_site test-dart
72+
continue-on-error: ${{ matrix.experimental }}
Lines changed: 44 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,49 @@
1-
name: build
1+
name: Docs site
22

33
on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- 'sites/docs/**'
9+
- 'examples/**'
10+
- 'packages/excerpter/**'
11+
- 'firebase.json'
12+
- 'tool/dash_site/**'
13+
- 'tool/config/linkcheck-skip-list.txt'
14+
- 'pubspec.yaml'
15+
- 'pubspec.lock'
16+
- 'analysis_options.yaml'
17+
- '.github/workflows/docs.yml'
718
pull_request:
819
branches:
920
- main
21+
paths:
22+
- 'sites/docs/**'
23+
- 'examples/**'
24+
- 'packages/excerpter/**'
25+
- 'firebase.json'
26+
- 'tool/dash_site/**'
27+
- 'tool/config/linkcheck-skip-list.txt'
28+
- 'pubspec.yaml'
29+
- 'pubspec.lock'
30+
- 'analysis_options.yaml'
31+
- '.github/workflows/docs.yml'
32+
# schedule:
33+
# - cron: '0 0 * * 0'
1034

11-
# Declare default permissions as read only.
1235
permissions: read-all
1336

14-
jobs:
15-
test:
16-
name: Analyze and test code examples
17-
runs-on: ubuntu-latest
18-
if: github.repository == 'cfug/flutter.cn'
19-
strategy:
20-
fail-fast: false
21-
matrix:
22-
include:
23-
- name: "Beta channel"
24-
branch: beta
25-
experimental: false
26-
- name: "Stable channel"
27-
branch: stable
28-
experimental: true
29-
continue-on-error: ${{ matrix.experimental }}
30-
steps:
31-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
32-
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
33-
with:
34-
channel: ${{ matrix.branch }}
35-
- name: Fetch Dart dependencies
36-
run: dart pub get
37-
continue-on-error: ${{ matrix.experimental }}
38-
- name: Check Dart code formatting
39-
run: dart run dash_site format-dart --check
40-
continue-on-error: ${{ matrix.experimental }}
41-
- name: Analyze Dart code
42-
run: dart run dash_site analyze-dart
43-
continue-on-error: ${{ matrix.experimental }}
44-
- name: Run Dart tests
45-
run: dart run dash_site test-dart
46-
continue-on-error: ${{ matrix.experimental }}
37+
concurrency:
38+
group: ${{ github.workflow }}-${{ github.ref }}
39+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
4740

41+
jobs:
4842
excerpts:
49-
name: Check if code excerpts are up to date
43+
name: Check code excerpts
5044
runs-on: ubuntu-latest
5145
if: github.repository == 'cfug/flutter.cn'
46+
timeout-minutes: 20
5247
steps:
5348
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
5449
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
@@ -57,14 +52,13 @@ jobs:
5752
- name: Fetch Dart dependencies
5853
run: dart pub get
5954
- name: Check if excerpts are up to date
60-
run: dart run dash_site refresh-excerpts --fail-on-update --dry-run
61-
continue-on-error: ${{ matrix.experimental }}
55+
run: dart run dash_site --site=docs refresh-excerpts --fail-on-update --dry-run
6256

6357
linkcheck:
64-
name: Build site and check links
58+
name: Build and check links
6559
runs-on: ubuntu-latest
66-
timeout-minutes: 30
6760
if: github.repository == 'cfug/flutter.cn'
61+
timeout-minutes: 30
6862
steps:
6963
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
7064
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
@@ -73,24 +67,25 @@ jobs:
7367
- name: Fetch Dart dependencies
7468
run: dart pub get
7569
- name: Install firebase-tools
76-
run: curl -sL https://firebase.tools/ | sed s/latest/v15.2.1/ | bash
70+
run: curl -sL https://firebase.tools | bash
7771
- name: Build site
78-
run: dart run dash_site build
79-
- uses: actions/setup-node@670825a89dc0abd596e7a3abd0f5e3f6e5faf37c
72+
run: dart run dash_site --site=docs build
73+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
8074
with:
8175
node-version: 24
8276
- name: Translated (docs.flutter.cn)
8377
run: bash tool/translator/build.sh
8478
shell: bash
8579
- name: Check for broken Markdown link references
86-
run: dart run dash_site check-link-references
80+
run: dart run dash_site --site=docs check-link-references
8781
- name: Check for broken internal links
88-
run: dart run dash_site check-links
82+
run: dart run dash_site --site=docs check-links
8983

9084
firebase-validate:
9185
name: Validate Firebase configuration
9286
runs-on: ubuntu-latest
9387
if: github.repository == 'cfug/flutter.cn'
88+
timeout-minutes: 10
9489
steps:
9590
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
9691
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
@@ -99,11 +94,11 @@ jobs:
9994
- name: Fetch Dart dependencies
10095
run: dart pub get
10196
- name: Validate the firebase.json file
102-
run: dart run dash_site verify-firebase-json
97+
run: dart run dash_site --site=docs verify-firebase-json
10398

10499
deploy:
105100
name: Deploy to production
106-
needs: [test, excerpts, linkcheck, firebase-validate]
101+
needs: [excerpts, linkcheck, firebase-validate]
107102
runs-on: ubuntu-latest
108103
if: |
109104
github.event_name == 'push' &&
@@ -120,8 +115,8 @@ jobs:
120115
- name: Fetch Dart dependencies
121116
run: dart pub get
122117
- name: Build site
123-
run: dart run dash_site build --release
124-
- uses: actions/setup-node@670825a89dc0abd596e7a3abd0f5e3f6e5faf37c
118+
run: dart run dash_site --site=docs build --release
119+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
125120
with:
126121
node-version: 24
127122
- name: Translated (docs.flutter.cn)

.github/workflows/stage.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ jobs:
1515
checks: write
1616
pull-requests: write
1717
runs-on: ubuntu-latest
18-
if: ${{ github.event.pull_request.head.repo.full_name == 'cfug/flutter.cn' }}
18+
if: |
19+
github.event.pull_request.head.repo.full_name == 'cfug/flutter.cn'
1920
steps:
2021
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
2122
with:
@@ -27,17 +28,17 @@ jobs:
2728
- name: Fetch Dart dependencies
2829
run: dart pub get
2930
- name: Build site
30-
run: dart run dash_site build --release
31-
- uses: actions/setup-node@670825a89dc0abd596e7a3abd0f5e3f6e5faf37c
31+
run: dart run dash_site --site=docs build --release
32+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
3233
with:
3334
node-version: 24
3435
- name: Translated (docs.flutter.cn)
3536
run: bash tool/translator/build.sh
3637
shell: bash
3738
- name: Stage
38-
if: ${{
39+
if: |
3940
github.repository == 'cfug/flutter.cn' &&
40-
github.event.pull_request.user.login != 'dependabot[bot]' }}
41+
github.event.pull_request.user.login != 'dependabot[bot]'
4142
uses: cfug/doc-site-preview-in-pr@main
4243
with:
4344
repoToken: '${{ secrets.GITHUB_TOKEN }}'

cloud_build/firebase-ghcli/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM dart:3.12.0@sha256:3d1b19886b288807b42020ede8f1f9ea7753c91c17c27479ee9e7bf584289a34
1+
FROM dart:3.12.1@sha256:6440c7d5fd8713b0706d0b6190eb2be7ad896101e225fc9d7657034b23ab0592
22

33
RUN apt-get update && apt-get install -y --no-install-recommends curl gpg ca-certificates \
44
# Install the GitHub CLI. \

cloud_build/firebase-ghcli/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,64 @@ When the `Dockerfile` file or `cloudbuild.yaml` template in this directory
1818
are changed in a PR, the cloud build template is triggered.
1919
Then a new version of the image is deployed as the latest version in
2020
Container Registry under the `flutter-dev-230821` project on Google Cloud.
21+
22+
## Updating the Dart SDK version
23+
24+
The base Dart image in `Dockerfile` is pinned by both tag and digest:
25+
26+
```dockerfile
27+
FROM dart:<version>@<digest>
28+
```
29+
30+
When updating the Dart SDK version, update both the tag and the digest.
31+
Use the multi-platform image index digest for the tag.
32+
Don't use a platform-specific digest, such as
33+
the digest for only `linux/amd64` or only `linux/arm64/v8`.
34+
35+
### Using `crane`
36+
37+
If you have the `crane` CLI from [`google/go-containerregistry`][], run:
38+
39+
```bash
40+
crane digest docker.io/library/dart:<STABLE_DART_SDK_VERSION>
41+
```
42+
43+
For example, the following command retrieves the digest for
44+
the `3.12.1` stable release of the SDK:
45+
46+
```bash
47+
crane digest docker.io/library/dart:3.12.1
48+
```
49+
50+
Copy the returned `sha256:...` digest.
51+
Then update the `FROM` line in the `Dockerfile` with
52+
the new tag (version) and copied index digest.
53+
54+
```dockerfile
55+
FROM dart:3.12.1@<digest from crane>
56+
```
57+
58+
Don't pass `--platform` when getting the digest for the `Dockerfile`.
59+
Passing a platform returns the digest for that platform's child manifest
60+
instead of the architecture-agnostic index digest.
61+
62+
[`google/go-containerregistry`]: https://github.com/google/go-containerregistry
63+
64+
### Using Docker Hub
65+
66+
If you don't have `crane`, use the
67+
[Dart image tags page on Docker Hub](https://hub.docker.com/_/dart/tags):
68+
69+
1. Search for the new Dart SDK version tag, such as `3.12.1`.
70+
1. Open the tag detail page by selecting the tag name or digest.
71+
1. Ensure the opened tag page has a `MULTI-PLATFORM` badge.
72+
1. Copy the specified `INDEX DIGEST` value.
73+
It should start with `sha256:`.
74+
1. Update the `FROM` line in the `Dockerfile` with
75+
the new tag (SDK version) and index digest.
76+
77+
<img
78+
width="688"
79+
height="248"
80+
alt="Screenshot of the index digest on Docker Hub, outlined with a red box."
81+
src="https://github.com/user-attachments/assets/909bd713-580f-41f5-882b-9afb3b9bbfaf" />

examples/_animation/basic_hero_animation/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: >-
55
66
resolution: workspace
77
environment:
8-
sdk: ^3.12.0-0
8+
sdk: ^3.12.0
99

1010
dependencies:
1111
flutter:

examples/_animation/basic_radial_hero_animation/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: >-
66
77
resolution: workspace
88
environment:
9-
sdk: ^3.12.0-0
9+
sdk: ^3.12.0
1010

1111
dependencies:
1212
flutter:

0 commit comments

Comments
 (0)