Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a workflow to deply the markdown playground #1966

Merged
merged 5 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/markdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -48,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
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/markdown_crash_test.yaml
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -9,10 +9,12 @@ on:
branches: [ main ]
paths:
- '.github/workflows/markdown_crash_test.yaml'
- 'pkgs/markdown/**'
pull_request:
devoncarew marked this conversation as resolved.
Show resolved Hide resolved
branches: [ main ]
paths:
- '.github/workflows/markdown_crash_test.yaml'
- 'pkgs/markdown/**'
schedule:
# “At 00:00 (UTC) on Sunday.”
- cron: '0 0 * * 0'
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/markdown_playground.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Publish the markdown playground to dart-lang.github.io/tools/markdown.

name: "package:markdown: playground"

on:
# Run on pushes to the default branch.
push:
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
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: setup pages
uses: actions/configure-pages@v5

- 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
4 changes: 4 additions & 0 deletions pkgs/markdown/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
.pub
pubspec.lock
doc/

example/app.dart.js
example/app.dart.js.deps
example/app.dart.js.map
5 changes: 5 additions & 0 deletions pkgs/markdown/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 7.3.1-wip

* Update the README link to the markdown playground
(https://dart-lang.github.io/tools).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should get a redirect in the old place, too.

https://github.com/dart-archive/dart-lang.github.io is how you do it. Not sure why it was archived.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably mean https://github.com/dart-lang/markdown (the archived repo above was for package:io).

+1 to a re-direct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I DON'T! You can put anything in dart-lang.github.io/XYZ. Even /markdown if the repo isn't there.


## 7.3.0

* Move to `dart-lang/tools` monorepo.
Expand Down
3 changes: 1 addition & 2 deletions pkgs/markdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pkgs/markdown/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading