Skip to content

Commit

Permalink
Rearchitecture (#3765)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
btobin and parlough authored Jan 20, 2022
1 parent 7ca1ffb commit 99fd6c7
Show file tree
Hide file tree
Showing 203 changed files with 2,768 additions and 2,469 deletions.
7 changes: 7 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "Dart.dev",
"dockerComposeFile": "../docker-compose.yml",
"extensions": [
"dart-code.dart-code"
]
}
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AUTHORS
CONTRIBUTING.md
LICENSE
README.md
deploy/
.github/
151 changes: 41 additions & 110 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,160 +3,91 @@ name: build
on:
# Run on PRs and pushes to the default branch.
push:
branches: [ master ]
branches:
- main
pull_request:
branches: [ master ]
branches:
- main
schedule:
- cron: "0 0 * * 0"

env:
_OS_NAME: linux
DART_SITE_ENV_DEFS: 1
JEKYLL_ENV: production
# Keep for Dart SDK reporting
PUB_ENVIRONMENT: bot.github
SITE_LOCALHOST_PORT: 5000
SITE_JEKYLL_DEST: _site
SITE_JEKYLL_SRC: src
TMP: ${{ github.workspace }}/tmp
TZ: US/Pacific # normalize build timestamp
# LTS
NODE_VERSION: '16'
# Tool location
BASE_DIR: ${{ github.workspace }}
TOOL_DIR: ${{ github.workspace }}/tool

jobs:

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [dev, beta, stable]
task:
- ./tool/build.sh --check-links
- ./tool/check-code.sh
experimental: [false]
include:
- sdk: dev
task: ./tool/analyze-and-test-examples.sh
experimental: false
- sdk: beta
task: ./tool/analyze-and-test-examples.sh
experimental: false
- sdk: stable
task: ./tool/analyze-and-test-examples.sh
experimental: false
sdk: [stable, beta, dev]
steps:
- uses: actions/checkout@v2
with:
# submodules param for checkout action to get site-shared, 'true' might be enough
submodules: "recursive"
- run: mkdir -p $TMP
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: ruby/setup-ruby@v1
if: contains(matrix.task, 'build.sh')
with:
bundler-cache: true
ruby-version: 2.7.4
- uses: dart-lang/setup-dart@v1.3
submodules: recursive
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- name: Install node dependencies
# TODO: caching requires a lockfile for node deps, so does npm ci.
run: npm install
- name: Install dart dependencies
run: dart pub get
- run: ./tool/shared/write-ci-info.sh -v
if: contains(matrix.task, 'build.sh')
- run: ${{ matrix.task }}
continue-on-error: ${{ matrix.experimental }}

# sdk-files-up-to-date:
# runs-on: ubuntu-latest
# if: |
# github.event_name == 'push'
# && github.ref == 'refs/heads/master'
# steps:
# - uses: actions/checkout@v2
# - run: mkdir -p $TMP
# - uses: dart-lang/setup-dart@v1.3
# with:
# sdk: stable
# - run: ./tool/check-diagnostics.sh

firebase-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: mkdir -p $TMP
- uses: dart-lang/setup-dart@v1.3
with:
sdk: stable
- run: ./tool/firebase-checks.sh
- run: dart pub get
- run: tool/test.sh
continue-on-error: true
env:
DART_CHANNEL: ${{ matrix.sdk }}

deploy:
needs: [test, firebase-checks]
if: ${{ github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
github.repository == 'dart-lang/site-www' }}
needs: test
runs-on: ubuntu-latest
if: |
github.event_name == 'push'
&& github.ref == 'refs/heads/master'
&& github.repository == 'dart-lang/site-www'
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_PROJECT: default
steps:
- uses: actions/checkout@v2
with:
# submodules param for checkout action to get site-shared, 'true' might be enough
submodules: "recursive"
- run: mkdir -p $TMP
submodules: recursive
- run: make build
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 2.7.4
- uses: dart-lang/setup-dart@v1.3
node-version: ${{ env.NODE_VERSION }}
- run: npm install -g firebase-tools
- uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: Install node dependencies
# TOOD: caching requires a lockfile for node deps, so does npm ci.
run: npm install
- name: Install dart dependencies
run: dart pub get
- run: ./tool/shared/write-ci-info.sh -v
- run: ./tool/build.sh
- run: ./tool/before-release.sh
- run: tool/check-links.sh
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DART_DEV }}'
projectId: dart-dev
channelId: live

deploy_preview:
stage:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
needs: test
runs-on: ubuntu-latest
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
steps:
- uses: actions/checkout@v2
with:
# submodules param for checkout action to get site-shared, 'true' might be enough
submodules: "recursive"
- run: mkdir -p $TMP
submodules: recursive
- run: make build
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 2.7.4
- uses: dart-lang/setup-dart@v1.3
node-version: ${{ env.NODE_VERSION }}
- run: npm install -g firebase-tools
- uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: Install node dependencies
# TOOD: caching requires a lockfile for node deps, so does npm ci.
run: npm install
- name: Install dart dependencies
run: dart pub get
- run: ./tool/shared/write-ci-info.sh -v
- run: ./tool/build.sh
- uses: FirebaseExtended/action-hosting-deploy@0e16177d01e10c4560245404f959e75a9c633533
- run: tool/check-links.sh
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DART_DEV }}'
Expand Down
45 changes: 20 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
*.iml
*.js.deps
*.pyc
*.swp
_asset_bundler_cache
_bookhtml
_cache/
_site/
.*-cache
.*-metadata
.buildlog
.dart_tool
.DS_Store
.env*
.firebase
.idea
.packages
.pub
.*-cache/
.vscode
.spelling
_asset_bundler_cache
_bookhtml
_cache/
_site
.vscode
*.cache
*.iml
*.js.deps
*.log
*.pyc
*.swp
*.zip
build
node_modules/
firebase-debug.log
node_modules
pubspec.lock

# We haven't had any issues due to npm (sub-)package version discrepancies,
# so we'll ignore the npm lock file for now.
package-lock.json

src/site/events/2015/summit/node_modules

/src/_data/ci.yaml

# Cache files
*.cache
.jekyll-metadata
tmp

# Misc
tmp
trash
firebase-debug.log
/src/_data/ci.yaml
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ the [GitHub Actions][] CI build will fail.
Just update the PR, and GitHub Actions will run again.

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

## A word about conduct

Expand Down
Loading

0 comments on commit 99fd6c7

Please sign in to comment.