Skip to content

Commit d92a2bf

Browse files
committed
build self-contained README.html
1 parent e2b41fc commit d92a2bf

2 files changed

Lines changed: 41 additions & 16 deletions

File tree

.github/workflows/release.yaml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,43 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13+
docs:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
18+
- name: Install Pandoc
19+
run: sudo apt-get update && sudo apt-get install -y pandoc
20+
21+
- name: Create Header
22+
run: |
23+
curl -L https://raw.githubusercontent.com/sindresorhus/github-markdown-css/main/github-markdown.css -o github.css
24+
echo '<style>' > header.html
25+
cat github.css >> header.html
26+
# Force the styles onto the body tag directly
27+
echo 'body { box-sizing: border-box; min-width: 300px; max-width: 980px; margin: 0 auto; padding: 45px; }' >> header.html
28+
echo '@media (max-width: 767px) { body { padding: 15px; } }' >> header.html
29+
echo '</style>' >> header.html
30+
echo '<article class="markdown-body">' > before.html
31+
echo '</article>' > after.html
32+
33+
pandoc README.md \
34+
-f gfm \
35+
-t html \
36+
--embed-resources \
37+
--standalone \
38+
--include-in-header=header.html \
39+
--include-before-body=before.html \
40+
--include-after-body=after.html \
41+
--metadata title="README" \
42+
-o README.html
43+
44+
- name: Upload Documentation Artifact
45+
uses: actions/upload-artifact@v7
46+
with:
47+
name: documentation
48+
path: README.html
49+
1350
build-linux-macos:
1451
runs-on: ${{ matrix.os }}
1552
strategy:
@@ -112,7 +149,7 @@ jobs:
112149
113150
release:
114151
runs-on: ubuntu-latest
115-
needs: [build-linux-macos, build-windows]
152+
needs: [docs, build-linux-macos, build-windows]
116153

117154
steps:
118155
- uses: actions/checkout@v6
@@ -146,6 +183,9 @@ jobs:
146183
do
147184
tar xvf $t
148185
done
186+
cp ./build/documentation/README.html openSAM-pkg/
187+
cp ./build/documentation/README.html openSAM-pkg/openSAM/
188+
cp ./build/documentation/README.html openSAM-pkg/openSAM_Library/
149189
bash ./sync_xp11_pkg.sh
150190
151191
- name: Prepare Skunkcrafts Updater

openSAM-pkg/README.html

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)