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 all 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
53 changes: 53 additions & 0 deletions .github/workflows/deploy_pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Publish the GitHub Pages site for this repo.

name: "Deploy Pages"

on:
# Run on pushes to the default branch.
push:
branches: [ main ]
paths:
- '.github/workflows/deploy_pages.yaml'
- '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

# Build the markdown playground.
- name: "markdown: pub get"
run: dart pub get
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: _site
- name: deploy to github pages
id: deployment
uses: actions/deploy-pages@v4
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
4 changes: 2 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 Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://dart.dev/tools/pub/private-files
.dart_tool
pubspec.lock
_site/
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
6 changes: 3 additions & 3 deletions pkgs/markdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +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/markdown](https://dart-lang.github.io/markdown).
[dart-lang.github.io/tools/markdown](https://dart-lang.github.io/tools/markdown).

### Usage

Expand Down
2 changes: 1 addition & 1 deletion pkgs/markdown/lib/src/version.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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