Skip to content

Commit b9d87f5

Browse files
Merge pull request #14 from sebastienrousseau/feat/html-generator
v0.0.3
2 parents 26f7763 + 39770fe commit b9d87f5

File tree

16 files changed

+5552
-363
lines changed

16 files changed

+5552
-363
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ env:
1919

2020
jobs:
2121
build:
22-
name: Build 🛠
22+
name: Build & Test 🛠
23+
# We build and test only when pushing to `main`; adjust if needed
2324
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
2425
strategy:
2526
fail-fast: false
@@ -35,32 +36,47 @@ jobs:
3536
target: aarch64-apple-darwin
3637
- os: ubuntu-latest
3738
target: x86_64-unknown-linux-gnu
39+
# Example: add WebAssembly if desired
40+
# - os: ubuntu-latest
41+
# target: wasm32-unknown-unknown
3842
runs-on: ${{ matrix.os }}
3943
steps:
4044
- uses: actions/checkout@v4
45+
46+
# Install Rust stable with required target
4147
- uses: actions-rs/toolchain@v1
4248
with:
4349
toolchain: stable
4450
target: ${{ matrix.target }}
4551
override: true
52+
53+
# Cache cargo artifacts
4654
- uses: actions/cache@v4
4755
with:
4856
path: |
4957
~/.cargo/registry
5058
~/.cargo/git
5159
target
5260
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
61+
62+
# Test on the specified OS & target
63+
- name: Test
64+
run: cargo test --verbose --target ${{ matrix.target }}
65+
66+
# Build for the specified OS & target
5367
- name: Build
5468
run: cargo build --verbose --release --target ${{ matrix.target }}
55-
- name: Package
69+
70+
# Package artifacts (Linux/macOS)
71+
- name: Package (Unix)
72+
if: matrix.os != 'windows-latest'
5673
run: |
57-
if [ ! -d "target/package" ]; then
58-
mkdir -p target/package
59-
fi
74+
mkdir -p target/package
6075
cd target/${{ matrix.target }}/release
6176
tar czf ../../package/${{ matrix.target }}.tar.gz *
6277
shell: bash
6378

79+
# Package artifacts (Windows)
6480
- name: Package (Windows)
6581
if: matrix.os == 'windows-latest'
6682
run: |
@@ -71,6 +87,7 @@ jobs:
7187
tar -czf ../../package/${{ matrix.target }}.tar.gz *
7288
shell: pwsh
7389

90+
# Upload artifacts for each target
7491
- uses: actions/upload-artifact@v4
7592
with:
7693
name: ${{ matrix.target }}
@@ -79,21 +96,26 @@ jobs:
7996
release:
8097
name: Release 🚀
8198
needs: build
99+
# Only release if we're pushing to `main` (adjust as you see fit)
82100
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
83101
runs-on: ubuntu-latest
84102
steps:
85103
- uses: actions/checkout@v4
104+
86105
- name: Set version
87106
run: echo "VERSION=$(grep -m 1 '^version =' Cargo.toml | cut -d '"' -f 2)" >> $GITHUB_ENV
107+
88108
- uses: actions/download-artifact@v4
89109
with:
90110
path: artifacts
111+
91112
- name: Generate Changelog
92113
run: |
93114
echo "## Release v${VERSION} - $(date +'%Y-%m-%d')" > CHANGELOG.md
94115
cat TEMPLATE.md >> CHANGELOG.md
95116
git log --pretty=format:'%s' --reverse HEAD >> CHANGELOG.md
96117
echo "" >> CHANGELOG.md
118+
97119
- uses: actions/create-release@v1
98120
env:
99121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -103,6 +125,7 @@ jobs:
103125
body_path: CHANGELOG.md
104126
draft: true
105127
prerelease: false
128+
106129
- name: Upload Release Assets
107130
run: |
108131
for asset in artifacts/*/*; do
@@ -117,10 +140,12 @@ jobs:
117140
runs-on: ubuntu-latest
118141
steps:
119142
- uses: actions/checkout@v4
143+
120144
- uses: actions-rs/toolchain@v1
121145
with:
122146
toolchain: stable
123147
override: true
148+
124149
- name: Publish
125150
run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
126151
env:

Cargo.toml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[package]
66
name = "html-generator"
7-
version = "0.0.2"
7+
version = "0.0.3"
88
edition = "2021"
99
rust-version = "1.56.0"
1010
license = "MIT OR Apache-2.0"
@@ -68,18 +68,19 @@ path = "src/lib.rs"
6868
[dependencies]
6969
# Dependencies required for building and running the project.
7070
cfg = "0.9.0"
71-
comrak = "0.32.0"
71+
comrak = { version = "0.32.0", features = ["syntect"] }
7272
lazy_static = "1.5.0"
7373
log = "0.4.22"
7474
mdx-gen = "0.0.1"
7575
minify-html = "0.15.0"
7676
once_cell = "1.20.2"
7777
regex = "1.11.1"
7878
scraper = "0.22.0"
79-
serde_json = "1.0.133"
79+
serde_json = "1.0.134"
8080
tempfile = "3.14.0"
81-
thiserror = "2.0.3"
82-
tokio = { version = "1.41.1", features = ["full"] }
81+
thiserror = "2.0.9"
82+
tokio = { version = "1.42.0", features = ["full"] }
83+
uuid = { version = "1.11.0", features = ["v4"] }
8384

8485
# -----------------------------------------------------------------------------
8586
# Build Dependencies
@@ -116,6 +117,10 @@ async = []
116117
name = "accessibility"
117118
path = "examples/accessibility_example.rs"
118119

120+
[[example]]
121+
name = "aria"
122+
path = "examples/aria_elements_example.rs"
123+
119124
[[example]]
120125
name = "basic"
121126
path = "examples/basic_example.rs"
@@ -148,6 +153,10 @@ path = "examples/performance_example.rs"
148153
name = "seo"
149154
path = "examples/seo_example.rs"
150155

156+
[[example]]
157+
name = "style"
158+
path = "examples/style_example.rs"
159+
151160
[[example]]
152161
name = "utils"
153162
path = "examples/utils_example.rs"

0 commit comments

Comments
 (0)