Skip to content

Commit

Permalink
[sync] 2023/11/15 (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 authored Nov 16, 2023
2 parents 8c080ff + ac0cece commit bda5429
Show file tree
Hide file tree
Showing 349 changed files with 7,978 additions and 6,204 deletions.
12 changes: 10 additions & 2 deletions .github/ISSUE_TEMPLATE/1_page_issue.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 文档或页面问题
description: 协助改进 dart.cn 的页面内容
title: "[PAGE ISSUE]: '{请替换为页面的标题}'"
title: '[页面问题] {请替换为页面的标题}'
labels: ['E: 页面问题']
body:
- type: markdown
Expand All @@ -11,7 +11,7 @@ body:
id: page-url
attributes:
label: 页面 URL
placeholder: "例如:https://dart.cn/docs"
placeholder: "例如:https://dart.cn/guides"
validations:
required: true
- type: input
Expand Down Expand Up @@ -42,3 +42,11 @@ body:
placeholder: 任何你认为我们需要知道的额外信息。
validations:
required: false
- type: checkboxes
id: volunteer
attributes:
label: 我想来解决这个问题。
description: 如果你想自己尝试修复,请告诉我们。
options:
- label: 我会尝试在 dart.cn 上解决这个问题。
required: false
21 changes: 3 additions & 18 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
Thanks for your contribution! Please replace this text with a description of what this PR is changing or adding and why, list any relevant issues, and review the contribution guidelines below.
**请点击「Preview」选择提交 PR 的模板**

Fixes <Replace with issue link>

---

- [ ] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
- [ ] This PR doesn’t contain automatically generated corrections or text (Grammarly, LLMs, and similar).
- [ ] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person).
- [ ] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer.

<details>
<summary>Contribution guidelines:</summary><br>

- See our [contributor guide](https://github.com/dart-lang/site-www/blob/main/CONTRIBUTING.md) for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before creating a PR.
- Code changes should generally follow the [Dart style guide](https://dart.dev/effective-dart) and use `dart format`.
- Updates to [code excerpts](https://github.com/dart-lang/site-shared/blob/main/doc/code-excerpts.md) indicated by `<?code-excerpt` need to be updated in their source `.dart` file as well.
</details>
- [内容修订](?template=1_cn_doc_fix.md)
- [新增翻译](?template=2_localization_submission.md)
16 changes: 10 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
# Keep for Dart SDK reporting
PUB_ENVIRONMENT: bot.github
# LTS
NODE_VERSION: '18'
NODE_VERSION: '20'
# Tool location
BASE_DIR: ${{ github.workspace }}
TOOL_DIR: ${{ github.workspace }}/tool
Expand All @@ -31,14 +31,18 @@ jobs:
fail-fast: false
matrix:
include:
# - sdk: dev
# experimental: false
- sdk: beta
experimental: false
- sdk: stable
experimental: false
continue-on-error: ${{ matrix.experimental }}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
submodules: recursive
- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
with:
sdk: ${{ matrix.sdk }}
- run: dart pub get
Expand All @@ -59,15 +63,15 @@ jobs:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_PROJECT: default
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
submodules: recursive
- run: make build
- run: make write-prod-robots
- uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
with:
node-version: ${{ env.NODE_VERSION }}
- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
with:
sdk: stable
#- run: tool/check-links.sh
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@0ba4244466797eb048eb91a6cd43d5c03ca8bd05
uses: github/codeql-action/init@74483a38d39275f33fcff5f35b679b5ca4a26a99
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -44,7 +44,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@0ba4244466797eb048eb91a6cd43d5c03ca8bd05
uses: github/codeql-action/autobuild@74483a38d39275f33fcff5f35b679b5ca4a26a99

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@0ba4244466797eb048eb91a6cd43d5c03ca8bd05
uses: github/codeql-action/analyze@74483a38d39275f33fcff5f35b679b5ca4a26a99
2 changes: 1 addition & 1 deletion .github/workflows/no-response.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
# Number of days of inactivity before an issue is closed for lack of response.
daysUntilClose: 21
# Label requiring a response.
responseRequiredLabel: "waiting for customer response"
responseRequiredLabel: "act.wait-for-customer"
8 changes: 4 additions & 4 deletions .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736
with:
results_file: results.sarif
results_format: sarif
Expand All @@ -41,14 +41,14 @@ jobs:

# Upload the results as artifacts (optional).
- name: "Upload artifact"
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@0ba4244466797eb048eb91a6cd43d5c03ca8bd05
uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99
with:
sarif_file: results.sarif
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ tmp
# Misc
trash
/src/_data/ci.yaml

# SHA Update
# The script generates the .save file in case you need a rollback.
*.save
tool/new-dart-hashes.txt
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "site-shared"]
path = site-shared
url = https://github.com/dart-lang/site-shared.git
branch = main
path = site-shared
url = https://github.com/dart-lang/site-shared
branch = main
61 changes: 34 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
FROM ruby:3.2-slim-bookworm@sha256:2de48b02b2c3383799991fd5573462a7646a92a068b4afbb0e161ad166a3de9a as base
FROM ruby:3.2-slim-bookworm@sha256:adc7f93df5b83c8627b3fadcc974ce452ef9999603f65f637e32b8acec096ae1 as base

SHELL ["/usr/bin/bash", "-c"]

# Configure Debian mirrors.
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=US/Pacific
ENV TZ=Asia/Shanghai
RUN apt update && apt install -yq --no-install-recommends \
build-essential \
ca-certificates \
curl \
git \
gnupg \
lsof \
make \
unzip \
Expand All @@ -32,27 +38,29 @@ ENV DART_SDK=/usr/lib/dart
ENV PATH=$DART_SDK/bin:$PATH
RUN set -eu; \
case "$(dpkg --print-architecture)_${DART_CHANNEL}" in \
# BEGIN dart-sha
amd64_stable) \
DART_SHA256="cccd5300faa5a9abce12a5f77586e26350028cea82bb4ff8eeb55641b58a2e1d"; \
DART_SHA256="4342ba274a4e9f8057079cf9de43b1c7bdb002016ad538313e8ebe942b61bba8"; \
SDK_ARCH="x64";; \
arm64_stable) \
DART_SHA256="2c8eeaf0d3da60c4e14beec45ce3b39aca754f71b9fa3fb0c635ee28d6f44708"; \
DART_SHA256="0f0e19c276c99fa3efd6428ea4bef1502f742f2a1f9772959637eec775c10ba0"; \
SDK_ARCH="arm64";; \
amd64_beta) \
DART_SHA256="e3bdf39358dda7f0fd02b25d4d4539536fff53b4ab257da31a5fbbe42edc28c9"; \
DART_SHA256="b3aa85b15bd13d619ba924524d5c7f082dc256a062ad34fe12ec824c9f05c2b3"; \
SDK_ARCH="x64";; \
arm64_beta) \
DART_SHA256="7e7c2d1d4c8c8a6a47d916f422ddad2d5497307a147fa860b7b063ffdd162939"; \
DART_SHA256="b7644435c8acf1e73da3f1ce16889b7222fbab37a75111aff225422a1cc61cab"; \
SDK_ARCH="arm64";; \
amd64_dev) \
DART_SHA256="53368087f4c191d8b55338d13c32a70bf6cbfb0a99b6b4d86e53cb366bfce446"; \
DART_SHA256="ae283eec0aa6e044064a79fc524af3dffec0543c48488538fc1a01a1fae7567b"; \
SDK_ARCH="x64";; \
arm64_dev) \
DART_SHA256="474a251dfa7f6ba41f68d889b774569c4d2da5b4262f0c48fa53424e5b42f200"; \
DART_SHA256="99153759fe1edbc5c1c6a8c5e5164fad11671eed8a8899bf127a17412b701172"; \
SDK_ARCH="arm64";; \
# END dart-sha
esac; \
SDK="dartsdk-linux-${SDK_ARCH}-release.zip"; \
BASEURL="https://storage.googleapis.com/dart-archive/channels"; \
BASEURL="https://storage.flutter-io.cn/dart-archive/channels"; \
URL="$BASEURL/$DART_CHANNEL/release/$DART_VERSION/sdk/$SDK"; \
curl -fsSLO "$URL"; \
echo "$DART_SHA256 *$SDK" | sha256sum --check --status --strict - || (\
Expand All @@ -78,21 +86,13 @@ CMD ["./tool/test.sh"]

# ============== NODEJS INSTALL ==============
FROM dart as node
RUN set -eu; \
NODE_PPA="node_ppa.sh"; \
NODE_SHA256=4ef190086f051a5242b8f9e7dff891d94c72bd484672d4a962f7189556977994; \
curl -fsSL https://deb.nodesource.com/setup_lts.x -o "$NODE_PPA"; \
echo "$NODE_SHA256 $NODE_PPA" | sha256sum --check --status --strict - || (\
echo -e "\n\nNODE CHECKSUM FAILED! Run tool/fetch-node-ppa-sum.sh for updated values.\n\n" && \
rm "$NODE_PPA" && \
exit 1 \
); \
sh "$NODE_PPA" && rm "$NODE_PPA"; \
apt-get update -q && apt-get install -yq --no-install-recommends \
nodejs \
&& rm -rf /var/lib/apt/lists/*
# Ensure latest NPM
RUN npm install -g npm

RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -yq \
&& apt-get install nodejs -yq \
&& npm install -g npm # Ensure latest npm


# ============== DEV/JEKYLL SETUP ==============
Expand All @@ -106,7 +106,8 @@ RUN BUNDLE_WITHOUT="test production" bundle install --jobs=4 --retry=2

ENV NODE_ENV=development
COPY package.json package-lock.json ./
RUN npm install
RUN npm install -g [email protected]
RUN npm ci

COPY ./ ./

Expand Down Expand Up @@ -137,7 +138,7 @@ CMD ["make", "emulate"]


# ============== BUILD PROD JEKYLL SITE ==============
FROM node AS build
FROM node as build
WORKDIR /app

ENV JEKYLL_ENV=production
Expand All @@ -147,7 +148,7 @@ RUN BUNDLE_WITHOUT="test development" bundle install --jobs=4 --retry=2 --quiet

ENV NODE_ENV=production
COPY package.json package-lock.json ./
RUN npm install
RUN npm ci

COPY ./ ./

Expand All @@ -164,4 +165,10 @@ RUN tool/translator/build.sh

# ============== DEPLOY to FIREBASE ==============
FROM build as deploy
# RUN npm install -g [email protected]
# ARG FIREBASE_TOKEN
# ENV FIREBASE_TOKEN=$FIREBASE_TOKEN
# ARG FIREBASE_PROJECT=default
# ENV FIREBASE_PROJECT=$FIREBASE_PROJECT
# RUN [[ -z "$FIREBASE_TOKEN" ]] && echo "FIREBASE_TOKEN is required for container deploy!"
RUN make deploy-ci
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

gem 'activesupport', '~> 7.0.6'
gem 'activesupport', '~> 7.1.2'
gem 'jekyll', '4.3.2'
gem 'jekyll-sass-converter', '~> 3.0.0'
gem 'kramdown-parser-gfm'
Expand Down
Loading

0 comments on commit bda5429

Please sign in to comment.