Skip to content

Commit 99fd6c7

Browse files
btobinparlough
andauthored
Rearchitecture (#3765)
* initial setup, docker, compose, gem updates * Initial script cleanup * dart channel sums for new version * finish test scripts, add bootstrap, relocate/refactor scss, remove all jekyll assets tags * reformat files, prepare for build action test * check sums * fix arch test command * remove tests for check sums * add defaults to check sums * update sums, format check file, test build only * Add node and firebase install to action * test link checker * Test check links step * check links script * Update tests, build * update analyze/test, fix test paths for action * fix path, missing vars * dart linkcheck, fix skip file, remove npm package * add dart install to build * Debug stage action task * Add back tests * css cleanup, QA bug fixes * Update src/overview.md Co-authored-by: Parker Lougheed <parlough@gmail.com> * Update src/multiplatform-apps.md Co-authored-by: Parker Lougheed <parlough@gmail.com> * Update src/multiplatform-apps.md Co-authored-by: Parker Lougheed <parlough@gmail.com> * Update src/_tutorials/web/get-started.md Co-authored-by: Parker Lougheed <parlough@gmail.com> * Update src/_guides/libraries/writing-package-pages.md Co-authored-by: Parker Lougheed <parlough@gmail.com> * Update src/_guides/libraries/create-library-packages.md Co-authored-by: Parker Lougheed <parlough@gmail.com> * Update src/_guides/libraries/writing-package-pages.md Co-authored-by: Parker Lougheed <parlough@gmail.com> * Update README * Remove node_modules mirror, overwrite robots * Reformat lang tour files again * Replace references to master with main * Change compose emulation port * Add staging task, use fb deploy action * Update src/_guides/libraries/create-library-packages.md Co-authored-by: Parker Lougheed <parlough@gmail.com> Co-authored-by: Parker Lougheed <parlough@gmail.com>
1 parent 7ca1ffb commit 99fd6c7

File tree

203 files changed

+2768
-2469
lines changed

Some content is hidden

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

203 files changed

+2768
-2469
lines changed

.devcontainer/devcontainer.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "Dart.dev",
3+
"dockerComposeFile": "../docker-compose.yml",
4+
"extensions": [
5+
"dart-code.dart-code"
6+
]
7+
}

.dockerignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
AUTHORS
2+
CONTRIBUTING.md
3+
LICENSE
4+
README.md
5+
deploy/
6+
.github/

.github/workflows/build.yml

+41-110
Original file line numberDiff line numberDiff line change
@@ -3,160 +3,91 @@ name: build
33
on:
44
# Run on PRs and pushes to the default branch.
55
push:
6-
branches: [ master ]
6+
branches:
7+
- main
78
pull_request:
8-
branches: [ master ]
9+
branches:
10+
- main
911
schedule:
1012
- cron: "0 0 * * 0"
1113

1214
env:
13-
_OS_NAME: linux
14-
DART_SITE_ENV_DEFS: 1
15-
JEKYLL_ENV: production
15+
# Keep for Dart SDK reporting
1616
PUB_ENVIRONMENT: bot.github
17-
SITE_LOCALHOST_PORT: 5000
18-
SITE_JEKYLL_DEST: _site
19-
SITE_JEKYLL_SRC: src
20-
TMP: ${{ github.workspace }}/tmp
21-
TZ: US/Pacific # normalize build timestamp
17+
# LTS
18+
NODE_VERSION: '16'
19+
# Tool location
20+
BASE_DIR: ${{ github.workspace }}
21+
TOOL_DIR: ${{ github.workspace }}/tool
2222

2323
jobs:
24+
2425
test:
2526
runs-on: ubuntu-latest
2627
strategy:
2728
fail-fast: false
2829
matrix:
29-
sdk: [dev, beta, stable]
30-
task:
31-
- ./tool/build.sh --check-links
32-
- ./tool/check-code.sh
33-
experimental: [false]
34-
include:
35-
- sdk: dev
36-
task: ./tool/analyze-and-test-examples.sh
37-
experimental: false
38-
- sdk: beta
39-
task: ./tool/analyze-and-test-examples.sh
40-
experimental: false
41-
- sdk: stable
42-
task: ./tool/analyze-and-test-examples.sh
43-
experimental: false
30+
sdk: [stable, beta, dev]
4431
steps:
4532
- uses: actions/checkout@v2
4633
with:
47-
# submodules param for checkout action to get site-shared, 'true' might be enough
48-
submodules: "recursive"
49-
- run: mkdir -p $TMP
50-
- uses: actions/setup-node@v2
51-
with:
52-
node-version: 16
53-
- uses: ruby/setup-ruby@v1
54-
if: contains(matrix.task, 'build.sh')
55-
with:
56-
bundler-cache: true
57-
ruby-version: 2.7.4
58-
- uses: dart-lang/setup-dart@v1.3
34+
submodules: recursive
35+
- uses: dart-lang/setup-dart@v1
5936
with:
6037
sdk: ${{ matrix.sdk }}
61-
- name: Install node dependencies
62-
# TODO: caching requires a lockfile for node deps, so does npm ci.
63-
run: npm install
64-
- name: Install dart dependencies
65-
run: dart pub get
66-
- run: ./tool/shared/write-ci-info.sh -v
67-
if: contains(matrix.task, 'build.sh')
68-
- run: ${{ matrix.task }}
69-
continue-on-error: ${{ matrix.experimental }}
70-
71-
# sdk-files-up-to-date:
72-
# runs-on: ubuntu-latest
73-
# if: |
74-
# github.event_name == 'push'
75-
# && github.ref == 'refs/heads/master'
76-
# steps:
77-
# - uses: actions/checkout@v2
78-
# - run: mkdir -p $TMP
79-
# - uses: dart-lang/setup-dart@v1.3
80-
# with:
81-
# sdk: stable
82-
# - run: ./tool/check-diagnostics.sh
83-
84-
firebase-checks:
85-
runs-on: ubuntu-latest
86-
steps:
87-
- uses: actions/checkout@v2
88-
- run: mkdir -p $TMP
89-
- uses: dart-lang/setup-dart@v1.3
90-
with:
91-
sdk: stable
92-
- run: ./tool/firebase-checks.sh
38+
- run: dart pub get
39+
- run: tool/test.sh
40+
continue-on-error: true
41+
env:
42+
DART_CHANNEL: ${{ matrix.sdk }}
9343

9444
deploy:
95-
needs: [test, firebase-checks]
45+
if: ${{ github.event_name == 'push' &&
46+
github.ref == 'refs/heads/main' &&
47+
github.repository == 'dart-lang/site-www' }}
48+
needs: test
9649
runs-on: ubuntu-latest
97-
if: |
98-
github.event_name == 'push'
99-
&& github.ref == 'refs/heads/master'
100-
&& github.repository == 'dart-lang/site-www'
50+
env:
51+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
52+
FIREBASE_PROJECT: default
10153
steps:
10254
- uses: actions/checkout@v2
10355
with:
104-
# submodules param for checkout action to get site-shared, 'true' might be enough
105-
submodules: "recursive"
106-
- run: mkdir -p $TMP
56+
submodules: recursive
57+
- run: make build
10758
- uses: actions/setup-node@v2
10859
with:
109-
node-version: 16
110-
- uses: ruby/setup-ruby@v1
111-
with:
112-
bundler-cache: true
113-
ruby-version: 2.7.4
114-
- uses: dart-lang/setup-dart@v1.3
60+
node-version: ${{ env.NODE_VERSION }}
61+
- run: npm install -g firebase-tools
62+
- uses: dart-lang/setup-dart@v1
11563
with:
11664
sdk: stable
117-
- name: Install node dependencies
118-
# TOOD: caching requires a lockfile for node deps, so does npm ci.
119-
run: npm install
120-
- name: Install dart dependencies
121-
run: dart pub get
122-
- run: ./tool/shared/write-ci-info.sh -v
123-
- run: ./tool/build.sh
124-
- run: ./tool/before-release.sh
65+
- run: tool/check-links.sh
12566
- uses: FirebaseExtended/action-hosting-deploy@v0
12667
with:
12768
repoToken: '${{ secrets.GITHUB_TOKEN }}'
12869
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DART_DEV }}'
12970
projectId: dart-dev
13071
channelId: live
13172

132-
deploy_preview:
73+
stage:
74+
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
13375
needs: test
13476
runs-on: ubuntu-latest
135-
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
13677
steps:
13778
- uses: actions/checkout@v2
13879
with:
139-
# submodules param for checkout action to get site-shared, 'true' might be enough
140-
submodules: "recursive"
141-
- run: mkdir -p $TMP
80+
submodules: recursive
81+
- run: make build
14282
- uses: actions/setup-node@v2
14383
with:
144-
node-version: 16
145-
- uses: ruby/setup-ruby@v1
146-
with:
147-
bundler-cache: true
148-
ruby-version: 2.7.4
149-
- uses: dart-lang/setup-dart@v1.3
84+
node-version: ${{ env.NODE_VERSION }}
85+
- run: npm install -g firebase-tools
86+
- uses: dart-lang/setup-dart@v1
15087
with:
15188
sdk: stable
152-
- name: Install node dependencies
153-
# TOOD: caching requires a lockfile for node deps, so does npm ci.
154-
run: npm install
155-
- name: Install dart dependencies
156-
run: dart pub get
157-
- run: ./tool/shared/write-ci-info.sh -v
158-
- run: ./tool/build.sh
159-
- uses: FirebaseExtended/action-hosting-deploy@0e16177d01e10c4560245404f959e75a9c633533
89+
- run: tool/check-links.sh
90+
- uses: FirebaseExtended/action-hosting-deploy@v0
16091
with:
16192
repoToken: '${{ secrets.GITHUB_TOKEN }}'
16293
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DART_DEV }}'

.gitignore

+20-25
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
1-
*.iml
2-
*.js.deps
3-
*.pyc
4-
*.swp
1+
_asset_bundler_cache
2+
_bookhtml
3+
_cache/
4+
_site/
5+
.*-cache
6+
.*-metadata
57
.buildlog
68
.dart_tool
79
.DS_Store
10+
.env*
11+
.firebase
812
.idea
913
.packages
1014
.pub
11-
.*-cache/
12-
.vscode
1315
.spelling
14-
_asset_bundler_cache
15-
_bookhtml
16-
_cache/
17-
_site
16+
.vscode
17+
*.cache
18+
*.iml
19+
*.js.deps
20+
*.log
21+
*.pyc
22+
*.swp
23+
*.zip
1824
build
19-
node_modules/
25+
firebase-debug.log
26+
node_modules
2027
pubspec.lock
21-
22-
# We haven't had any issues due to npm (sub-)package version discrepancies,
23-
# so we'll ignore the npm lock file for now.
24-
package-lock.json
25-
26-
src/site/events/2015/summit/node_modules
27-
28-
/src/_data/ci.yaml
29-
30-
# Cache files
31-
*.cache
32-
.jekyll-metadata
28+
tmp
3329

3430
# Misc
35-
tmp
3631
trash
37-
firebase-debug.log
32+
/src/_data/ci.yaml

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ the [GitHub Actions][] CI build will fail.
8181
Just update the PR, and GitHub Actions will run again.
8282

8383
[GitHub Actions]: https://docs.github.com/actions/learn-github-actions/understanding-github-actions
84-
[/src/_guides/language/language-tour.md]: https://github.com/dart-lang/site-www/blob/master/src/_guides/language/language-tour.md
85-
[/examples/misc/lib/language_tour/variables.dart]: https://github.com/dart-lang/site-www/blob/master/examples/misc/lib/language_tour/variables.dart
84+
[/src/_guides/language/language-tour.md]: https://github.com/dart-lang/site-www/blob/main/src/_guides/language/language-tour.md
85+
[/examples/misc/lib/language_tour/variables.dart]: https://github.com/dart-lang/site-www/blob/main/examples/misc/lib/language_tour/variables.dart
8686

8787
## A word about conduct
8888

0 commit comments

Comments
 (0)