Skip to content

Commit 7fcf623

Browse files
authored
add a workflow to deply the markdown playground (#1966)
1 parent 30de295 commit 7fcf623

File tree

9 files changed

+85
-9
lines changed

9 files changed

+85
-9
lines changed

.github/workflows/deploy_pages.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Publish the GitHub Pages site for this repo.
2+
3+
name: "Deploy Pages"
4+
5+
on:
6+
# Run on pushes to the default branch.
7+
push:
8+
branches: [ main ]
9+
paths:
10+
- '.github/workflows/deploy_pages.yaml'
11+
- 'pkgs/markdown/**'
12+
13+
jobs:
14+
deploy:
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
runs-on: ubuntu-latest
20+
environment:
21+
name: github-pages
22+
url: ${{steps.deployment.outputs.page_url}}
23+
24+
steps:
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
26+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
27+
28+
# Build the markdown playground.
29+
- name: "markdown: pub get"
30+
run: dart pub get
31+
working-directory: pkgs/markdown
32+
- name: "markdown: build playground"
33+
run: >
34+
dart compile js -o example/app.dart.js
35+
--minify --no-frequency-based-minification --no-source-maps
36+
example/app.dart
37+
working-directory: pkgs/markdown/example
38+
39+
# Create the _site directory.
40+
- run: mkdir _site
41+
- run: cp -r pkgs/markdown/example _site/markdown
42+
- run: rm _site/markdown/*.dart
43+
44+
# Deploy to GitHub Pages.
45+
- name: setup pages
46+
uses: actions/configure-pages@v5
47+
- name: upload artifact
48+
uses: actions/upload-pages-artifact@v3
49+
with:
50+
path: _site
51+
- name: deploy to github pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

.github/workflows/markdown.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ on:
1818
env:
1919
PUB_ENVIRONMENT: bot.github
2020

21-
2221
defaults:
2322
run:
2423
working-directory: pkgs/markdown/
2524

26-
2725
jobs:
2826
# Check code formatting and static analysis on a single OS (linux)
2927
# against Dart dev.
@@ -48,6 +46,21 @@ jobs:
4846
run: dart analyze --fatal-infos
4947
if: always() && steps.install.outcome == 'success'
5048

49+
# Ensure the markdown playground builds.
50+
build-playground:
51+
runs-on: ubuntu-latest
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
sdk: [stable]
56+
steps:
57+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
58+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
59+
with:
60+
sdk: ${{ matrix.sdk }}
61+
- run: dart pub get
62+
- run: dart compile js -o example/app.dart.js example/app.dart
63+
5164
# Run tests on a matrix consisting of two dimensions:
5265
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
5366
# 2. release channel: dev

.github/workflows/markdown_crash_test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Run against all markdown files in latest version of packages on pub.dev to
2-
# see if any can provoke a crash
1+
# Run against all markdown files in the latest version of packages on pub.dev
2+
# to see if any can provoke a crash.
33

44
name: "package:markdown: crash tests"
55

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# https://dart.dev/tools/pub/private-files
22
.dart_tool
33
pubspec.lock
4+
_site/

pkgs/markdown/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
.pub
44
pubspec.lock
55
doc/
6+
7+
example/app.dart.js
8+
example/app.dart.js.deps
9+
example/app.dart.js.map

pkgs/markdown/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 7.3.1-wip
2+
3+
* Update the README link to the markdown playground
4+
(https://dart-lang.github.io/tools).
5+
16
## 7.3.0
27

38
* Move to `dart-lang/tools` monorepo.

pkgs/markdown/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
[![pub package](https://img.shields.io/pub/v/markdown.svg)](https://pub.dev/packages/markdown)
33
[![package publisher](https://img.shields.io/pub/publisher/markdown.svg)](https://pub.dev/packages/markdown/publisher)
44

5-
A portable Markdown library written in Dart. It can parse Markdown into
6-
HTML on both the client and server.
5+
A portable Markdown library written in Dart. It can parse Markdown into HTML on
6+
both the client and server.
77

88
Play with it at
9-
[dart-lang.github.io/markdown](https://dart-lang.github.io/markdown).
9+
[dart-lang.github.io/tools/markdown](https://dart-lang.github.io/tools/markdown).
1010

1111
### Usage
1212

pkgs/markdown/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgs/markdown/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: markdown
2-
version: 7.3.0
2+
version: 7.3.1-wip
33
description: >-
44
A portable Markdown library written in Dart that can parse Markdown into HTML.
55
repository: https://github.com/dart-lang/tools/tree/main/pkgs/markdown

0 commit comments

Comments
 (0)