From c083e860f91725b520d191d248c3777c3973ec1f Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Tue, 14 Jan 2025 12:42:54 -0800 Subject: [PATCH 1/5] work on deploying the markdown playground --- .github/workflows/markdown.yaml | 2 - .github/workflows/markdown_crash_test.yaml | 6 ++- .github/workflows/markdown_playground.yaml | 50 ++++++++++++++++++++++ pkgs/markdown/.gitignore | 4 ++ 4 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/markdown_playground.yaml diff --git a/.github/workflows/markdown.yaml b/.github/workflows/markdown.yaml index 59654b79d..71fc3bdfd 100644 --- a/.github/workflows/markdown.yaml +++ b/.github/workflows/markdown.yaml @@ -18,12 +18,10 @@ on: env: PUB_ENVIRONMENT: bot.github - defaults: run: working-directory: pkgs/markdown/ - jobs: # Check code formatting and static analysis on a single OS (linux) # against Dart dev. diff --git a/.github/workflows/markdown_crash_test.yaml b/.github/workflows/markdown_crash_test.yaml index 1a00047d7..852e46529 100644 --- a/.github/workflows/markdown_crash_test.yaml +++ b/.github/workflows/markdown_crash_test.yaml @@ -1,5 +1,5 @@ -# Run against all markdown files in latest version of packages on pub.dev to -# see if any can provoke a crash +# Run against all markdown files in the latest version of packages on pub.dev +# to see if any can provoke a crash. name: "package:markdown: crash tests" @@ -9,10 +9,12 @@ on: branches: [ main ] paths: - '.github/workflows/markdown_crash_test.yaml' + - 'pkgs/markdown/**' pull_request: branches: [ main ] paths: - '.github/workflows/markdown_crash_test.yaml' + - 'pkgs/markdown/**' schedule: # “At 00:00 (UTC) on Sunday.” - cron: '0 0 * * 0' diff --git a/.github/workflows/markdown_playground.yaml b/.github/workflows/markdown_playground.yaml new file mode 100644 index 000000000..364f06977 --- /dev/null +++ b/.github/workflows/markdown_playground.yaml @@ -0,0 +1,50 @@ +# Publish the markdown playground to dart-lang.github.io/tools/markdown. + +name: "package:markdown: playground" + +on: + # Run on PRs and pushes to the default branch. + push: + branches: [ main ] + paths: + - '.github/workflows/markdown_playground.yaml' + - 'pkgs/markdown/**' + pull_request: + branches: [ main ] + paths: + - '.github/workflows/markdown_playground.yaml' + - 'pkgs/markdown/**' + +defaults: + run: + working-directory: pkgs/markdown/ + +jobs: + deploy: + permissions: + contents: read + pages: write + id-token: write + runs-on: ubuntu-latest + needs: jekyll-build + environment: + name: github-pages + url: ${{steps.deployment.outputs.page_url}} + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + + - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 + + - name: Install dependencies + run: dart pub get + + - name: Build markdown playground + run: dart compile js -o example/app.dart.js --minify --no-frequency-based-minification --no-source-maps example/app.dart + + - name: Deploy artifact + id: deployment + uses: actions/deploy-pages@v4 + +todo: split into 'build' and 'deploy' + diff --git a/pkgs/markdown/.gitignore b/pkgs/markdown/.gitignore index 6ff0be3dc..a48b1c475 100644 --- a/pkgs/markdown/.gitignore +++ b/pkgs/markdown/.gitignore @@ -3,3 +3,7 @@ .pub pubspec.lock doc/ + +example/app.dart.js +example/app.dart.js.deps +example/app.dart.js.map From c31c72e57c2b9bf27388a6576f4611fa750961df Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Tue, 14 Jan 2025 13:41:23 -0800 Subject: [PATCH 2/5] add a workflow to deply the markdown playground --- .github/workflows/markdown.yaml | 15 +++++++++++ .github/workflows/markdown_playground.yaml | 29 +++++++++++----------- pkgs/markdown/README.md | 3 +-- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.github/workflows/markdown.yaml b/.github/workflows/markdown.yaml index 71fc3bdfd..5b4e569fb 100644 --- a/.github/workflows/markdown.yaml +++ b/.github/workflows/markdown.yaml @@ -46,6 +46,21 @@ jobs: run: dart analyze --fatal-infos if: always() && steps.install.outcome == 'success' + # Ensure the markdown playground builds. + build-playground: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sdk: [stable] + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 + with: + sdk: ${{ matrix.sdk }} + - run: dart pub get + - run: dart compile js -o example/app.dart.js example/app.dart + # Run tests on a matrix consisting of two dimensions: # 1. OS: ubuntu-latest, (macos-latest, windows-latest) # 2. release channel: dev diff --git a/.github/workflows/markdown_playground.yaml b/.github/workflows/markdown_playground.yaml index 364f06977..9fa6e750d 100644 --- a/.github/workflows/markdown_playground.yaml +++ b/.github/workflows/markdown_playground.yaml @@ -3,18 +3,13 @@ name: "package:markdown: playground" on: - # Run on PRs and pushes to the default branch. + # Run on pushes to the default branch. push: branches: [ main ] paths: - '.github/workflows/markdown_playground.yaml' - 'pkgs/markdown/**' - pull_request: - branches: [ main ] - paths: - - '.github/workflows/markdown_playground.yaml' - - 'pkgs/markdown/**' - + defaults: run: working-directory: pkgs/markdown/ @@ -26,25 +21,31 @@ jobs: pages: write id-token: write runs-on: ubuntu-latest - needs: jekyll-build environment: name: github-pages url: ${{steps.deployment.outputs.page_url}} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 - name: Install dependencies run: dart pub get - name: Build markdown playground - run: dart compile js -o example/app.dart.js --minify --no-frequency-based-minification --no-source-maps example/app.dart + run: > + dart compile js -o example/app.dart.js + --minify --no-frequency-based-minification --no-source-maps + example/app.dart - - name: Deploy artifact - id: deployment - uses: actions/deploy-pages@v4 + - name: setup pages + uses: actions/configure-pages@v5 -todo: split into 'build' and 'deploy' + - name: upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: pkgs/markdown/example + - name: deploy to github pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/pkgs/markdown/README.md b/pkgs/markdown/README.md index 3b87484d1..3c3c0466e 100644 --- a/pkgs/markdown/README.md +++ b/pkgs/markdown/README.md @@ -5,8 +5,7 @@ A portable Markdown library written in Dart. It can parse Markdown into HTML on both the client and server. -Play with it at -[dart-lang.github.io/markdown](https://dart-lang.github.io/markdown). +Play with it at [dart-lang.github.io/tools](https://dart-lang.github.io/tools). ### Usage From 6905aa80b9b2bd1ce10ca4f0e7adc82290bf4111 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Tue, 14 Jan 2025 13:52:49 -0800 Subject: [PATCH 3/5] update the package version and changelog --- pkgs/markdown/CHANGELOG.md | 5 +++++ pkgs/markdown/pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/markdown/CHANGELOG.md b/pkgs/markdown/CHANGELOG.md index 5f9f48af8..4b20f92f9 100644 --- a/pkgs/markdown/CHANGELOG.md +++ b/pkgs/markdown/CHANGELOG.md @@ -1,3 +1,8 @@ +## 7.3.1-wip + +* Update the README link to the markdown playground + (https://dart-lang.github.io/tools). + ## 7.3.0 * Move to `dart-lang/tools` monorepo. diff --git a/pkgs/markdown/pubspec.yaml b/pkgs/markdown/pubspec.yaml index fadd44fa7..4f0c0d331 100644 --- a/pkgs/markdown/pubspec.yaml +++ b/pkgs/markdown/pubspec.yaml @@ -1,5 +1,5 @@ name: markdown -version: 7.3.0 +version: 7.3.1-wip description: >- A portable Markdown library written in Dart that can parse Markdown into HTML. repository: https://github.com/dart-lang/tools/tree/main/pkgs/markdown From 7b9f8d980236778c8bde6e9b2e70f4aeefcf1650 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Tue, 14 Jan 2025 14:03:00 -0800 Subject: [PATCH 4/5] update version.dart --- pkgs/markdown/lib/src/version.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/markdown/lib/src/version.dart b/pkgs/markdown/lib/src/version.dart index 1e5327efa..bd14228ed 100644 --- a/pkgs/markdown/lib/src/version.dart +++ b/pkgs/markdown/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '7.3.0'; +const packageVersion = '7.3.1-wip'; From 1c64ca25b10c71d913c9301f3d3ba80a18a5855f Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Wed, 15 Jan 2025 10:14:37 -0800 Subject: [PATCH 5/5] deploy the site to a markdown/ subdir --- ...down_playground.yaml => deploy_pages.yaml} | 28 ++++++++++--------- .github/workflows/markdown_crash_test.yaml | 2 -- .gitignore | 1 + pkgs/markdown/README.md | 7 +++-- 4 files changed, 20 insertions(+), 18 deletions(-) rename .github/workflows/{markdown_playground.yaml => deploy_pages.yaml} (64%) diff --git a/.github/workflows/markdown_playground.yaml b/.github/workflows/deploy_pages.yaml similarity index 64% rename from .github/workflows/markdown_playground.yaml rename to .github/workflows/deploy_pages.yaml index 9fa6e750d..e0c2034b2 100644 --- a/.github/workflows/markdown_playground.yaml +++ b/.github/workflows/deploy_pages.yaml @@ -1,19 +1,15 @@ -# Publish the markdown playground to dart-lang.github.io/tools/markdown. +# Publish the GitHub Pages site for this repo. -name: "package:markdown: playground" +name: "Deploy Pages" on: # Run on pushes to the default branch. push: branches: [ main ] paths: - - '.github/workflows/markdown_playground.yaml' + - '.github/workflows/deploy_pages.yaml' - 'pkgs/markdown/**' -defaults: - run: - working-directory: pkgs/markdown/ - jobs: deploy: permissions: @@ -29,23 +25,29 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 - - name: Install dependencies + # Build the markdown playground. + - name: "markdown: pub get" run: dart pub get - - - name: Build markdown playground + working-directory: pkgs/markdown + - name: "markdown: build playground" run: > dart compile js -o example/app.dart.js --minify --no-frequency-based-minification --no-source-maps example/app.dart + working-directory: pkgs/markdown/example + + # Create the _site directory. + - run: mkdir _site + - run: cp -r pkgs/markdown/example _site/markdown + - run: rm _site/markdown/*.dart + # Deploy to GitHub Pages. - name: setup pages uses: actions/configure-pages@v5 - - name: upload artifact uses: actions/upload-pages-artifact@v3 with: - path: pkgs/markdown/example - + path: _site - name: deploy to github pages id: deployment uses: actions/deploy-pages@v4 diff --git a/.github/workflows/markdown_crash_test.yaml b/.github/workflows/markdown_crash_test.yaml index 852e46529..6e7aad2cd 100644 --- a/.github/workflows/markdown_crash_test.yaml +++ b/.github/workflows/markdown_crash_test.yaml @@ -9,12 +9,10 @@ on: branches: [ main ] paths: - '.github/workflows/markdown_crash_test.yaml' - - 'pkgs/markdown/**' pull_request: branches: [ main ] paths: - '.github/workflows/markdown_crash_test.yaml' - - 'pkgs/markdown/**' schedule: # “At 00:00 (UTC) on Sunday.” - cron: '0 0 * * 0' diff --git a/.gitignore b/.gitignore index 4fe7cd529..d92c88004 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ # https://dart.dev/tools/pub/private-files .dart_tool pubspec.lock +_site/ diff --git a/pkgs/markdown/README.md b/pkgs/markdown/README.md index 3c3c0466e..5642563b7 100644 --- a/pkgs/markdown/README.md +++ b/pkgs/markdown/README.md @@ -2,10 +2,11 @@ [![pub package](https://img.shields.io/pub/v/markdown.svg)](https://pub.dev/packages/markdown) [![package publisher](https://img.shields.io/pub/publisher/markdown.svg)](https://pub.dev/packages/markdown/publisher) -A portable Markdown library written in Dart. It can parse Markdown into -HTML on both the client and server. +A portable Markdown library written in Dart. It can parse Markdown into HTML on +both the client and server. -Play with it at [dart-lang.github.io/tools](https://dart-lang.github.io/tools). +Play with it at +[dart-lang.github.io/tools/markdown](https://dart-lang.github.io/tools/markdown). ### Usage